summaryrefslogtreecommitdiff
path: root/editors
diff options
context:
space:
mode:
authoritojun <itojun>2000-09-08 16:56:58 +0000
committeritojun <itojun>2000-09-08 16:56:58 +0000
commitf6d6091e20452fbcd5d81b2f96b376afcfa09b57 (patch)
treead9cd3c9ffe2d7796467d5f2ee79687f7bae9db3 /editors
parent537e984a4d74eccf9deea8600bd169fe38cf037a (diff)
downloadpkgsrc-f6d6091e20452fbcd5d81b2f96b376afcfa09b57.tar.gz
try 2nd and subsequent destination if we have multiple addresses resolved
from an FQDN hostname. patch from kazu@kame.net, sync with kame tree. repairs PR 10972.
Diffstat (limited to 'editors')
-rw-r--r--editors/emacs/files/patch-sum4
-rw-r--r--editors/emacs/patches/patch-aj150
2 files changed, 70 insertions, 84 deletions
diff --git a/editors/emacs/files/patch-sum b/editors/emacs/files/patch-sum
index 452917aab34..bda50ad877b 100644
--- a/editors/emacs/files/patch-sum
+++ b/editors/emacs/files/patch-sum
@@ -1,4 +1,4 @@
-$NetBSD: patch-sum,v 1.14 2000/08/23 16:20:17 toshii Exp $
+$NetBSD: patch-sum,v 1.15 2000/09/08 16:56:58 itojun Exp $
MD5 (patch-aa) = 41d31356a0b856d789ded3ef10bb4349
MD5 (patch-ab) = ef7e12a958af844399e841d2205995d7
@@ -8,7 +8,7 @@ MD5 (patch-af) = 139ec0b39a8bad5ab5cdc2c3785a59de
MD5 (patch-ag) = 66bceb249ab91847d660da95d08844c2
MD5 (patch-ah) = ea0578999fe8adc5b8434e3d05f60cae
MD5 (patch-ai) = 7d171eaaa0489cf4f24fd89fe45fda9e
-MD5 (patch-aj) = 2826479143a847192c969b7e8f623ade
+MD5 (patch-aj) = 2f1e748154c00130ff26c1b29c2f0c5b
MD5 (patch-ak) = ef7fabe3fea75d799d8628d155a8b72c
MD5 (patch-ax) = 46750ed00d5bff9fea4f330b0ca0fc41
MD5 (patch-ay) = 39327beca758ac8d2cd9eab329beb5e6
diff --git a/editors/emacs/patches/patch-aj b/editors/emacs/patches/patch-aj
index 5383bc56c7a..7270e29d633 100644
--- a/editors/emacs/patches/patch-aj
+++ b/editors/emacs/patches/patch-aj
@@ -1,7 +1,7 @@
-$NetBSD: patch-aj,v 1.7 2000/06/24 17:03:38 minoura Exp $
+$NetBSD: patch-aj,v 1.8 2000/09/08 16:56:58 itojun Exp $
--- src/process.c.orig Wed May 24 04:10:16 2000
-+++ src/process.c Sun Jun 18 09:20:15 2000
++++ src/process.c Mon Sep 4 14:15:19 2000
@@ -1,7 +1,18 @@
+/*
+ * Locally hacked process.c to add ipv6 support. -wsr
@@ -25,8 +25,12 @@ $NetBSD: patch-aj,v 1.7 2000/06/24 17:03:38 minoura Exp $
{
Lisp_Object proc;
register int i;
-+
-+#ifndef HAVE_GETADDRINFO
++#ifdef HAVE_GETADDRINFO
++ struct addrinfo hints, *res, *lres;
++ int ret = 0;
++ int xerrno = 0;
++ char *portstring, portbuf [128];
++#else /* HAVE_GETADDRINFO */
struct sockaddr_in address;
struct servent *svc_info;
struct hostent *host_info_ptr, host_info;
@@ -37,12 +41,8 @@ $NetBSD: patch-aj,v 1.7 2000/06/24 17:03:38 minoura Exp $
- int port;
struct hostent host_info_fixed;
+ int port;
-+#else /* HAVE_GETADDRINFO */
-+ struct addrinfo hints, *res, *lres;
-+ int ret;
-+ char *portstring, portbuf [128];
+#endif /* HAVE_GETADDRINFO */
-+ int s, outch, inch;
++ int s = -1, outch, inch;
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
int retry = 0;
int count = specpdl_ptr - specpdl;
@@ -69,105 +69,91 @@ $NetBSD: patch-aj,v 1.7 2000/06/24 17:03:38 minoura Exp $
if (INTEGERP (service))
port = htons ((unsigned short) XINT (service));
else
-@@ -1841,6 +1874,8 @@
+@@ -1841,6 +1874,7 @@
error ("Unknown service \"%s\"", XSTRING (service)->data);
port = svc_info->s_port;
}
+#endif /* HAVE_GETADDRINFO */
-+
/* Slow down polling to every ten seconds.
Some kernels have a bug which causes retrying connect to fail
-@@ -1850,6 +1885,88 @@
+@@ -1850,6 +1884,75 @@
#endif
#ifndef TERM
-+#ifdef HAVE_GETADDRINFO /* We have a modern OS. -wsr */
-+ {
-+ immediate_quit = 1;
-+ QUIT;
-+ memset(&hints, 0, sizeof(hints));
-+ hints.ai_flags = AI_NUMERICHOST;
-+ hints.ai_family = AF_UNSPEC;
-+ hints.ai_socktype = SOCK_STREAM;
-+ hints.ai_protocol = 0;
-+ ret = getaddrinfo(XSTRING (host)->data, portstring, &hints, &res);
-+ if (!ret) { /* numeric */
-+ freeaddrinfo(res);
-+ hints.ai_flags = AI_CANONNAME;
-+ } else { /* non-numeric */
-+ hints.ai_flags = 0;
-+ }
-+ ret = getaddrinfo(XSTRING (host)->data, portstring, &hints, &res);
-+ if (ret){
-+ error("%s/%s %s", XSTRING (host)->data, portstring,
-+ gai_strerror(ret));
-+ }
-+ immediate_quit = 0;
-+ }
-+
-+ lres = res;
-+ addrloop: /* address loop */
++#ifdef HAVE_GETADDRINFO /* We have a modern OS. -wsr */
++ immediate_quit = 1;
++ QUIT;
++ memset(&hints, 0, sizeof(hints));
++ hints.ai_flags = 0;
++ hints.ai_family = AF_UNSPEC;
++ hints.ai_socktype = SOCK_STREAM;
++ hints.ai_protocol = 0;
++ ret = getaddrinfo(XSTRING (host)->data, portstring, &hints, &res);
++ if (ret)
++ error("%s/%s %s", XSTRING (host)->data, portstring, gai_strerror(ret));
++ immediate_quit = 0;
++
++ for (lres = res; lres ; lres = lres->ai_next)
++ {
+ s = socket(lres->ai_family, lres->ai_socktype, lres->ai_protocol);
-+ if (s < 0)
-+ report_file_error ("error creating socket", Fcons (name, Qnil));
++ if (s < 0)
++ {
++ xerrno = errno;
++ continue;
++ }
+
+ /* Kernel bugs (on Ultrix at least) cause lossage (not just EINTR)
-+ when connect is interrupted. So let's not let it get interrupted.
-+ Note we do not turn off polling, because polling is only used
-+ when not interrupt_input, and thus not normally used on the systems
-+ which have this bug. On systems which use polling, there's no way
-+ to quit if polling is turned off. */
++ when connect is interrupted. So let's not let it get interrupted.
++ Note we do not turn off polling, because polling is only used
++ when not interrupt_input, and thus not normally used on the systems
++ which have this bug. On systems which use polling, there's no way
++ to quit if polling is turned off. */
+ if (interrupt_input)
-+ unrequest_sigio ();
-+
-+ loop:
++ unrequest_sigio ();
+
++ loop:
+ immediate_quit = 1;
+ QUIT;
+
-+ if (connect(s, lres->ai_addr, lres->ai_addrlen) == -1
-+ && errno != EISCONN)
-+ {
-+ int xerrno = errno;
-+
-+ immediate_quit = 0;
-+
-+ if (errno == EINTR)
-+ goto loop;
-+ if (errno == EADDRINUSE && retry < 20)
-+ {
-+ /* A delay here is needed on some FreeBSD systems,
-+ and it is harmless, since this retrying takes time anyway
-+ and should be infrequent. */
-+ Fsleep_for (make_number (1), Qnil);
-+ retry++;
-+ goto loop;
-+ }
-+
-+ close (s);
-+
-+ if (interrupt_input)
-+ request_sigio ();
++ if (connect(s, lres->ai_addr, lres->ai_addrlen) == 0 ||
++ errno == EISCONN)
++ break;
+
-+ if (lres->ai_next) {
-+ lres = lres->ai_next;
-+ goto addrloop;
-+ }
++ xerrno = errno;
++ immediate_quit = 0;
+
++ if (errno == EINTR)
++ goto loop;
++ if (errno == EADDRINUSE && retry < 20)
++ {
++ /* A delay here is needed on some FreeBSD systems,
++ and it is harmless, since this retrying takes time anyway
++ and should be infrequent. */
++ Fsleep_for (make_number (1), Qnil);
++ retry++;
++ goto loop;
++ }
++
++ close(s);
++ s = -1;
++ }
+
-+ errno = xerrno;
-+ report_file_error ("connection failed",
-+ Fcons (host, Fcons (name, Qnil)));
-+ }
-+ /* address loop */
+ freeaddrinfo(res);
++ if (s < 0)
++ {
++ if (interrupt_input)
++ request_sigio ();
++
++ errno = xerrno;
++ report_file_error ("connection failed",
++ Fcons (host, Fcons (name, Qnil)));
++ }
+#else /* HAVE_GETADDRINFO */
-+
while (1)
{
#ifdef TRY_AGAIN
-@@ -1940,6 +2057,7 @@
+@@ -1940,6 +2043,7 @@
report_file_error ("connection failed",
Fcons (host, Fcons (name, Qnil)));
}