]> git.sesse.net Git - vlc/blobdiff - src/network/tcp.c
Use var_Inherit* instead of var_CreateGet*.
[vlc] / src / network / tcp.c
index 7b1cdfa30135b9b3d16017b524ee4ee7db7a89c0..778a2d7d51707ce374bee9835bbee3b670e9362d 100644 (file)
@@ -85,6 +85,7 @@ int net_Connect( vlc_object_t *p_this, const char *psz_host, int i_port,
         return -1;
 
     memset( &hints, 0, sizeof( hints ) );
+    hints.ai_socktype = type;
     hints.ai_protocol = proto;
 
     psz_socks = var_CreateGetNonEmptyString( p_this, "socks" );
@@ -142,7 +143,7 @@ int net_Connect( vlc_object_t *p_this, const char *psz_host, int i_port,
     if( i_val )
     {
         msg_Err( p_this, "cannot resolve %s port %d : %s", psz_realhost,
-                 i_realport, vlc_gai_strerror( i_val ) );
+                 i_realport, gai_strerror( i_val ) );
         return -1;
     }
 
@@ -215,7 +216,7 @@ next_ai: /* failure */
         continue;
     }
 
-    vlc_freeaddrinfo( res );
+    freeaddrinfo( res );
 
     if( i_handle == -1 )
         return -1;
@@ -459,7 +460,7 @@ static int SocksHandshakeTCP( vlc_object_t *p_obj,
         SetWBE( &buffer[2], i_port );   /* Port */
         memcpy( &buffer[4],             /* Address */
                 &((struct sockaddr_in *)(p_res->ai_addr))->sin_addr, 4 );
-        vlc_freeaddrinfo( p_res );
+        freeaddrinfo( p_res );
 
         buffer[8] = 0;                  /* Empty user id */