]> git.sesse.net Git - vlc/commitdiff
Revert [21457] it was completely wrong.
authorJean-Paul Saman <jpsaman@videolan.org>
Fri, 24 Aug 2007 10:10:34 +0000 (10:10 +0000)
committerJean-Paul Saman <jpsaman@videolan.org>
Fri, 24 Aug 2007 10:10:34 +0000 (10:10 +0000)
src/network/getaddrinfo.c

index f5603f49f987de9baef416b80d14fce8afd72f20..35c584e9d4d46ae6983f844a8b4be9938ca56969 100644 (file)
@@ -289,7 +289,7 @@ static int WSAAPI
 getaddrinfo (const char *node, const char *service,
              const struct addrinfo *hints, struct addrinfo **res)
 #else
-static int
+static int 
 getaddrinfo (const char *node, const char *service,
              const struct addrinfo *hints, struct addrinfo **res)
 #endif
@@ -558,6 +558,7 @@ int vlc_getnameinfo( const struct sockaddr *sa, int salen,
     return i_val;
 }
 
+
 int vlc_getaddrinfo( vlc_object_t *p_this, const char *node,
                      int i_port, const struct addrinfo *p_hints,
                      struct addrinfo **res )
@@ -580,15 +581,12 @@ int vlc_getaddrinfo( vlc_object_t *p_this, const char *node,
 
     /* Check if we have to force ipv4 or ipv6 */
     memset (&hints, 0, sizeof (hints));
-    if( p_hints != NULL )
+    if (p_hints != NULL)
     {
-        int ai_flags = AI_NUMERICHOST|AI_PASSIVE;
-        if( node )
-            ai_flags |= AI_CANONNAME;
         hints.ai_family = p_hints->ai_family;
         hints.ai_socktype = p_hints->ai_socktype;
         hints.ai_protocol = p_hints->ai_protocol;
-        hints.ai_flags = p_hints->ai_flags & (ai_flags);
+        hints.ai_flags = p_hints->ai_flags & (AI_NUMERICHOST|AI_PASSIVE|AI_CANONNAME);
     }
 #ifdef AI_NUMERICSERV
     /* we only ever use port *numbers* */
@@ -620,7 +618,6 @@ int vlc_getaddrinfo( vlc_object_t *p_this, const char *node,
     if( ( node == NULL ) || (node[0] == '\0' ) )
     {
         psz_node = NULL;
-        hints.ai_flags &= ~AI_CANONNAME;
     }
     else
     {