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.