[gnutls-help] DTLS and retransmission and reordering
Joke de Buhr
joke at seiken.de
Wed Apr 10 18:07:49 CEST 2013
yes i'm using the non-blocking mode. for client and server sesssion.
gnutls_init(&session_, GNUTLS_DATAGRAM | GNUTLS_NONBLOCK | ...);
here is a stack trace where the pull function is called:
#0 _gnutls_io_check_recv() at /lib/gnutls_buffers.c:677
#1 _dtls_wait_and_retransmit() at /lib/gnutls_dtls.c:414
#2 _gnutls_recv_handshake_final() at /lib/gnutls_handshake.c:2883
#3 _gnutls_handshake_client() at /lib/gnutls_handshake.c:2730
#4 gnutls_handshake() at /lib/gnutls_handshake.c:2450
#5 session<server::gateway<server::server<boost::asio::ip::udp> >
>::handshake() at /home/joke/Projects/vpn/src/session.t++:175
the pull timeout function returns GNUTLS_E_AGAIN.
but _dtls_retransmit is called only if the return value was GNUTLS_E_TIMEDOUT.
in _dtls_wait_and_retransmit around gnutls_dtls.c:416.
i noticed around /lib/gnutls_handshake.c:2879
_dtls_is_async(...) returns 0
i don't know if that's any kind of problem.
On Wednesday 10 April 2013 16:56:39 Nikos Mavrogiannopoulos wrote:
> On 04/10/2013 04:30 PM, Joke de Buhr wrote:
> > thanks for the hint.
> > i did some debugging and discovered why no data was retransmitted.
> > if the timer runs out and calls handshake() gnutls calls the pull timeout
> > function a couple of times to check the io state before it checks if a
> > retransmission needs to take place.
> > since my pull timeout function doesn't block and always returns EAGAIN
> > unless there are actually packets which can be pulled in gnutls got stuck
> > and didn't consider the timer ran out already.
> > i'm not entirely sure if this is the correct behavior. especially if
> > gnutls is running in non-blocking dtls mode it might be wise to check for
> > retransmission if the pull timeout function returns EAGAIN.
> But do you use it in non-blocking mode? The behavior of gnutls is
> different in that mode, it shouldn't have called this function.
> btw. if possible please follow up on the original thread on the list
> with the solution.
More information about the Gnutls-help