]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
Tor Arntsen's patch for working around a notorious bug in the AIX5
authorDaniel Stenberg <daniel@haxx.se>
Mon, 9 Feb 2004 07:52:36 +0000 (07:52 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 9 Feb 2004 07:52:36 +0000 (07:52 +0000)
getaddrinfo() implementation.

lib/ftp.c

index 49a46fe997916e1eebceb4e78c0814b341bc3567..5450c854386abec5215ee26c044433a92e4f9801 100644 (file)
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -1167,6 +1167,12 @@ CURLcode ftp_use_port(struct connectdata *conn)
   
   portsock = -1;
   for (ai = res; ai; ai = ai->ai_next) {
+    /*
+     * Workaround for AIX5 getaddrinfo() problem (it doesn't set ai_socktype):
+     */
+    if (ai->ai_socktype == 0)
+      ai->ai_socktype = hints.ai_socktype;
+
     portsock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
     if (portsock < 0)
       continue;