GNU bug report logs - #22789
25.1.50; In last master build https connections stop working

Previous Next

Package: emacs;

Reported by: José L. Doménech <j_l_domenech <at> yahoo.com>

Date: Wed, 24 Feb 2016 10:29:02 UTC

Severity: normal

Found in version 25.1.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Alain Schneble <a.s <at> realize.ch>
Cc: larsi <at> gnus.org, j_l_domenech <at> yahoo.com, 22789 <at> debbugs.gnu.org
Subject: bug#22789: 25.1.50; In last master build https connections stop working
Date: Mon, 07 Mar 2016 18:07:54 +0200
> From: Alain Schneble <a.s <at> realize.ch>
> CC: <larsi <at> gnus.org>, <j_l_domenech <at> yahoo.com>, <22789 <at> debbugs.gnu.org>
> Date: Mon, 7 Mar 2016 00:24:35 +0100
> 
> > I'll send a patch for further discussions shortly.
> 
> And here it is.  The fix is quite simple.  It ensures that sys_write
> exits before touching the socket if it is not connected yet.
> Unfortunately I didn't find any documentation on winsock ioctlsocket
> that would prove that this is indeed required.  But it seems not wrong
> to me anyway.  (I'll try to search the wisock documentation tomorrow to
> find some hints that lead in this direction, or maybe you know?)

I think this change should be installed regardless, as it fixes an
oversight.  However, I think it needs to be augmented, because the
fact that FILE_CONNECT flag is set doesn't necessarily mean the
connection is in progress: it could have failed already.  We need to
look at the status as well.

The possible states of the FILE_CONNECT flag and the cp->status values
are:

  flag    status                      description
  ----------------------------------------------------------------------------
  ON      STATUS_READ_READY           reader thread is about to try connect
  ON      STATUS_READ_FAILED          reader thread waits in _sys_wait_connect
  ON      STATUS_READ_SUCCEEDED       reader thread successfully connected
  ON      STATUS_CONNECT_FAILED       reader thread failed to connect
  OFF     STATUS_READ_ACKNOWLEDGED    sys_select acknowledged successful connect
  OFF     STATUS_READ_READY           reader thread is about to read
  OFF     STATUS_READ_IN_PROGRESS     reader thread waits in _sys_read_ahead
  OFF     STATUS_READ_SUCCEEDED       reader thread succeeded in reading
  OFF     STATUS_READ_FAILED          reader thread failed to read

So we should only return EWOULDBLOCK when FILE_CONNECT is set _and_
the status is not STATUS_CONNECT_FAILED.  If FILE_CONNECT is set, but
the status is STATUS_CONNECT_FAILED, we should instead return the
value computed from cp->errcode (if it is non-zero).  There's an
example of that in sys_read.

Other than that, what specific problem does your change try or is
known to solve?  IOW, what didn't work before the change, and works
after it?

Thanks.




This bug report was last modified 9 years and 132 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.