]> Pileus Git - ~andy/fetchmail/commitdiff
IP-address hostnames work again.
authorEric S. Raymond <esr@thyrsus.com>
Tue, 26 Oct 1999 17:30:10 +0000 (17:30 -0000)
committerEric S. Raymond <esr@thyrsus.com>
Tue, 26 Oct 1999 17:30:10 +0000 (17:30 -0000)
svn path=/trunk/; revision=2639

NEWS
socket.c

diff --git a/NEWS b/NEWS
index 3a6bd86e4f96377c462177627dd42112b2a2edac..b7ba4fea88eb9bea7e44c1b68a7362a674a191e5 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,7 @@
 * Grant Edwards's patch to correct NTLM behavior.
 * In IMAP, set Seen flag explicity when keep is on; works around flaky
   servers that don't set Seen on a body fetch.
+* James Bristers fix for IP-address hostnames.
 
 fetchmail-5.1.2 (Thu Oct  7 09:46:07 EDT 1999), 17906 lines:
 * Joe Loughry <loughry@uswest.net> sent a patch to handle multihomed machines.
index 058fe2d505123e27ed3625fdb0945802bb3ddd7a..db0d7000332fd4c547ac5974cc35b3c5de614aef 100644 (file)
--- a/socket.c
+++ b/socket.c
@@ -248,6 +248,23 @@ int SockOpen(const char *host, int clientPort, const char *options,
            errno = olderr;
            return -1;
        }
+    } else {
+        ad.sin_port = htons(clientPort);
+
+        sock = socket(AF_INET, SOCK_STREAM, 0);
+        if (sock < 0)
+        {
+            h_errno = 0;
+            return -1;
+        }
+        if (connect(sock, (struct sockaddr *) &ad, sizeof(ad)) < 0)
+        {
+            int olderr = errno;
+            close(sock);
+            h_errno = 0;
+            errno = olderr;
+            return -1;
+        }
     }
     return(sock);
 }