Subject: Re: bug#23225: 25.1.50; url-retrieve-synchronously having trouble with some https URLs

From: Tao Fang <[email-masked]>
Date: Sun, 31 Jul 2016 00:44:30 +0800

I've tested on macOS Sierra 10.12(16A254g)/Xcode 7.3.1(7D1014), emacs
(compiled from git master --with-gnutls) and gnutls-3.5.2 (compiled from
source), and same problem here.
  
> gnutls.c: [2] WRITE: -1 returned from 0x12, errno: 57
  errno 57 is ENOTCONN (defined in /usr/include/sys/errno.h) in the case
of that after called connect() with asynchronous socket, when TCP
three-way handshake was not accomplished, calling write() will return
ENOTCONN. I'm not sure if this conform POSIX.1 since the manual(man 2
write) mentions standards and AFAIK [EAGAIN] or [EWOULDBLOCK] would be a
better choice.
  And gnutls didn't properly handle error 57(ENOTCONN) in errno_to_gerr()
(lib/buffers.c), I've fired a bug report with above message at:
  https://gitlab.com/gnutls/gnutls/issues/117

  Back to emacs, and after some searching and compiling test, it seems
that this commit cause the master branch broken on OS X:

    63efcc268635dea78c6bd80749eae4ee2c72d717
    Author:     John Wiegley <[email-masked]>
    AuthorDate: Fri Mar 11 13:33:32 2016 -0800
    Commit:     John Wiegley <[email-masked]>
    CommitDate: Fri Mar 11 13:33:32 2016 -0800
    
    Parent:     b4fbd69 ; Merge from origin/emacs-25
    Parent:     facb5e2 Update Emacs manual section related to character
    folding
    Containing: master
    Follows:    emacs-25.0.92 (3006)

this problem doesn't exist before that, and current emacs-25 branch is
also good.