bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#23982: [master] Treat errno EINPROGRESS and ENOTCONN as EAGAIN for a


From: jun_hao
Subject: bug#23982: [master] Treat errno EINPROGRESS and ENOTCONN as EAGAIN for async connection
Date: Sat, 16 Jul 2016 23:03:22 +0800

> On Jul 16, 2016, at 11:33, npostavs@users.sourceforge.net wrote:
> 
> Jun Hao <jun_hao@aol.com> writes:
>> 
>> For latest master branch, when try to use gnutls with async connection,
>> the handshake will return fatal error if socket is in ENOTCONN or
>> EINPROGRESS since gnutls treat these errors as fatal during push/pull
>> and gives up. The later retry will fail because gnutls will mark the
>> session invalid.
>> 
>> This patch is asking gnutls to treat them as EAGAIN which is non-fatal.
>> 
>> I only tested with OSX. Please see if you can reproduce it on Windows or
>> Linux and if this patch works for them too.
>> 
>> To reproduce run:
>> 
>> emacs -Q --eval "(erc-tls :server \"irc.freenode.net\" :port 6697 :nick 
>> \"test\")"
>> 
>> Current master branch will gave up connecting.
> 
> On both Window and GNU/Linux this successfully connect both with and
> without the patch, i.e., patch seems not to be needed on non-OSX
> platforms, but it doesn't seem to hurt either.

I think it depends on how fast is connect call succeed. If it's already 
connected before handshake, it'll be okay. The default method that gnutls uses 
is send(2), which requires the underlying socket to be in connected state. I'm 
not sure if it's because of OSX or maybe slow internet connection at this point.

Thanks - Jun





reply via email to

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