]> git.sesse.net Git - vlc/blobdiff - src/network/tcp.c
Use var_Inherit* instead of var_CreateGet*.
[vlc] / src / network / tcp.c
index 9c35f16600f67da29226970df52a4281ca7a4773..778a2d7d51707ce374bee9835bbee3b670e9362d 100644 (file)
@@ -43,7 +43,6 @@
 #endif
 
 #include <vlc_network.h>
-#include <vlc_fs.h>
 #if defined (WIN32) || defined (UNDER_CE)
 #   undef EINPROGRESS
 #   define EINPROGRESS WSAEWOULDBLOCK
@@ -86,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" );
@@ -143,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;
     }
 
@@ -216,7 +216,7 @@ next_ai: /* failure */
         continue;
     }
 
-    vlc_freeaddrinfo( res );
+    freeaddrinfo( res );
 
     if( i_handle == -1 )
         return -1;
@@ -460,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 */