all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: jun_hao@aol.com
To: npostavs@users.sourceforge.net, 23982@debbugs.gnu.org
Subject: bug#23982: [master] Treat errno EINPROGRESS and ENOTCONN as EAGAIN for async connection
Date: Sat, 16 Jul 2016 23:03:22 +0800	[thread overview]
Message-ID: <047A0010-1FF9-48A4-B8C2-6121C2CED9D5@aol.com> (raw)
In-Reply-To: <87k2gmdzpv.fsf@users.sourceforge.net>


> 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





  parent reply	other threads:[~2016-07-16 15:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-14 14:17 bug#23982: [master] Treat errno EINPROGRESS and ENOTCONN as EAGAIN for async connection Jun Hao
2016-07-16  3:33 ` npostavs
2016-07-16  6:44   ` Eli Zaretskii
2016-07-16 15:03   ` jun_hao [this message]
2016-07-26  7:35 ` Paul Eggert
2016-07-26 14:48   ` Ted Zlatanov
2016-07-26 15:08     ` Eli Zaretskii
2016-07-26 15:14       ` Ted Zlatanov
2016-08-03  9:02       ` Paul Eggert
2016-08-04 14:22         ` Ted Zlatanov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=047A0010-1FF9-48A4-B8C2-6121C2CED9D5@aol.com \
    --to=jun_hao@aol.com \
    --cc=23982@debbugs.gnu.org \
    --cc=npostavs@users.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.