Try other addresses when connecting to multihomed
commit2989ad906048b374653d7030ebdaea62b670eed0
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 26 Jun 2016 21:27:21 +0000 (26 23:27 +0200)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 26 Jun 2016 21:37:03 +0000 (26 23:37 +0200)
treee05911945e6dad1249f2afea4cc6bbb6e03169f0
parentd267aea2424783f5eefb6e733a6806ffd3323fa0
Try other addresses when connecting to multihomed

Problem reported by Juliusz Chroboczek (Bug#17976)
and by Artur Malabarba (Bug#23620).
Patch from a suggestion by Andreas Schwab in:
http://bugs.gnu.org/17976#39
This patch is for non-MS-Windows platforms.
I don't know the situation on MS-Windows.
* src/process.c (connecting_status):
New function, for (connect . ADDRINFOS).
(connect_network_socket, check_for_dns, wait_for_socket_fds)
(wait_while_connecting, wait_reading_process_output, status_notify):
Use it.
(decode_status, Fmake_network_process):
Support (connect . ADDRINFOS) status.
(connect_network_socket) [!WINDOWSNT]:
If the connection failed and there are other addresses to try, do not
signal an error; instead, loop around to try the next address.
(wait_reading_process_output): Advance to the next address
if there are multiple addresses and the first remaining address
failed.
* src/process.h (struct Lisp_Process.status): Adjust comment
to describe (connect . ADDRINFOS).
src/process.c
src/process.h