]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - cups/http-addr.c
Merge changes from CUPS 1.3.1.
[thirdparty/cups.git] / cups / http-addr.c
index 14e6112def13f867a1ad9971e75154d9eb1c5b63..58504ca1df68c0a6e48649cf6773fbc3f649b39e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: http-addr.c 6649 2007-07-11 21:46:42Z mike $"
+ * "$Id: http-addr.c 6816 2007-08-20 20:16:00Z mike $"
  *
  *   HTTP address routines for the Common UNIX Printing System (CUPS).
  *
@@ -197,18 +197,17 @@ httpAddrLookup(
 #endif /* AF_LOCAL */
 #ifdef HAVE_GETNAMEINFO
   {
-    if (getnameinfo(&addr->addr, httpAddrLength(addr), name, namelen,
-                    NULL, 0, 0))
-    {
-     /*
-      * If we get an error back, then the address type is not supported
-      * and we should zero out the buffer...
-      */
-
-      name[0] = '\0';
+   /*
+    * STR #2486: httpAddrLookup() fails when getnameinfo() returns EAI_AGAIN
+    *
+    * FWIW, I think this is really a bug in the implementation of
+    * getnameinfo(), but falling back on httpAddrString() is easy to
+    * do...
+    */
 
-      return (NULL);
-    }
+    if (getnameinfo(&addr->addr, httpAddrLength(addr), name, namelen,
+                   NULL, 0, 0))
+      return (httpAddrString(addr, name, namelen));
   }
 #else
   {
@@ -553,5 +552,5 @@ httpGetHostname(http_t *http,               /* I - HTTP connection or NULL */
 
 
 /*
- * End of "$Id: http-addr.c 6649 2007-07-11 21:46:42Z mike $".
+ * End of "$Id: http-addr.c 6816 2007-08-20 20:16:00Z mike $".
  */