[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gnutls_record_recv timeout with blocking sockets
From: |
Nikos Mavrogiannopoulos |
Subject: |
Re: gnutls_record_recv timeout with blocking sockets |
Date: |
Mon, 23 May 2011 21:21:25 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110424 Thunderbird/3.1.10 |
On 05/23/2011 07:41 PM, Giuseppe Scrivano wrote:
>>> In wget we are using something like the following pseudo-code to
>>> check if a call to `gnutls_record_recv' will be blocking:
>>> gnutls_record_check_pending (session) || select_fd (fd, timeout);
>>> I have noticed that even if the previous code returns a non-zero value,
>>> `gnutls_record_recv' can still block.
>>
>> Could you distinguish which was the function that triggered the
>> recv, (i.e. gnutls_record_check_pending() or select_fd()?).
>
> Sorry that I haven't mentioned it before, `select_fd' triggers the read.
Then, as Sam mentioned, there is not much gnutls can do. That could
be either because of the bugs mentioned by Sam, or because gnutls is
blocked waiting for a TLS record. The ways to avoid this would be
either by using non-blocking sockets or by having a timeout in the
recv function provided to gnutls.
regards,
Nikos