|
From: | Ken Brown |
Subject: | bug#23658: 25.1.50; make-network-connection fails to connect to IPv6 address on Windows |
Date: | Wed, 1 Jun 2016 17:55:18 -0400 |
User-agent: | Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 |
On 6/1/2016 3:57 PM, Fran wrote:
Removing the ":nowait t" makes it connect successfully to the IPv6 address. In that case, it works regardless of whether ":family 'ipv6" is present. If this were my personal code that would be a sufficient workaround, but I found this bug in ERC (the Emacs IRC client), and I think it is designed so that make-network-process has to connect asynchronously.
This sounds similar to the situation I faced in bug#23606. (But in that case specifying :family solved the problem). Here's what I suspect is happening:
In src/process.c there's a loop starting at line 3138 in which the code runs through a list of possible addrinfo structures in the hopes of finding one it can connect to. In the asynchronous case, it doesn't wait to see if the connection is successful; this is only discovered later (around line 5495). At this point it's too late to try another addrinfo structure, and a "failed" message is generated (line 5523) if the connection didn't succeed.
I think it would be better if the loop would delay making the connection asynchronous (line 3160 or 3171) until it's known that the connection has succeeded.
Lars, is there any reason not to do it that way? Ken
[Prev in Thread] | Current Thread | [Next in Thread] |