X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fnetwork%2Ftcp.c;h=778a2d7d51707ce374bee9835bbee3b670e9362d;hb=8faa8a8fc0fedeb05517e8ff9d86e4d1649605e7;hp=9c35f16600f67da29226970df52a4281ca7a4773;hpb=af64d14a00bbaca4c17b7f3feb7399d7a0363f23;p=vlc diff --git a/src/network/tcp.c b/src/network/tcp.c index 9c35f16600..778a2d7d51 100644 --- a/src/network/tcp.c +++ b/src/network/tcp.c @@ -43,7 +43,6 @@ #endif #include -#include #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 */