Subject: Re: bug#22789: 25.1.50; In last master build https connections stop working

From: Alain Schneble <[email-masked]>
Date: Sun, 28 Feb 2016 00:06:22 +0100

Lars Ingebrigtsen <[email-masked]> writes:

> I think you're on to something!
>
> The thing starts with
>
> 	      nread = read_process_output (proc, channel);
>
> and for un-setup TLS sockets, it'll now get back -1, and it should
> ideally end up in the
>
> 	      else if (nread == -1 && errno == EAGAIN)
> 		;
>
> thing, so that it tries again later.  But errno is not EAGAIN here
> (usually)...

I suspected this as well.

> Does the following patch make things work on Windows?

But unfortunately, it does not work, also with this patch applied.  The
problem seems to happen earlier.

In w32.c (emacs_gnutls_push) I see that sys_write returns with 0.  But
the buffer to write contains sz=255 bytes.  And here errno is 0 after
the write.  This is strange.  I guess that here errno should be set to
EAGAIN... I mean in sys_write...

After this broken emacs_gnutls_push call, gnutls_handshake returns:

-53 GNUTLS_E_PUSH_ERROR
And later...
-10 GNUTLS_E_INVALID_SESSION.