gnutls-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: W32 testsuite results


From: Nikos Mavrogiannopoulos
Subject: Re: W32 testsuite results
Date: Tue, 05 Apr 2011 20:59:23 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110223 Thunderbird/3.1.8

On 04/05/2011 02:27 PM, LRN wrote:

>> This shouldn't be a problem. The mini-* programs use fd==0xfffffff
>> because they emulate the communication and don't really use an fd.
> I think i've found the problem. The code in client_pull() in mini.c
> calls gnutls_transport_set_global_errno (EAGAIN); to tell gnutls library
> code that the pull operation should be postponed. However, gnutls
> library code in _gnutls_read() in gnutls_buffers.c:306 calls int err =
> get_errno (session); to obain errno, which, in turn, returns
> session->internals.errno_func (session->internals.transport_recv_ptr);,
> which is the same as system_errno(session->internals.transport_recv_ptr)
> at system.c:55, which simply calls WSAGetLastError(), switch'es over its
> value and sets errno.
> That is, the problem is in the fact that on Windows gnutls assumes that
> underlying read() implementation is incapable of setting errno and is,
> in fact, a socket (since gnutls uses WSAGetLastError()).
> Possible fixes:
> A) Fix gnutls_transport_set_global_errno() to call SetLastError() (note
> that there's no difference between WSAGLE and GLE, unless you're writing
> for WinSock 1.x, which is crazy, because WinSock 2.x has been shipped
> with NT since NT 4.0). And maybe set errno too, just to be safe.

I think I'll switch it to gnutls_transport_set_errno(), fix and
deprecate the set_global_errno() function. I don't see any point
in it as a function.

regards,
Nikos



reply via email to

[Prev in Thread] Current Thread [Next in Thread]