gnutls-devel
[Top][All Lists]
Advanced

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

Re: W32 testsuite results


From: LRN
Subject: Re: W32 testsuite results
Date: Tue, 05 Apr 2011 23:08:26 +0400
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0pre) Gecko/20110404 Thunderbird/3.3a4pre

On 05.04.2011 22:59, Nikos Mavrogiannopoulos wrote:
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.
How do you access a session object in pull function?



reply via email to

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