diff options
author | diego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2009-05-13 02:58:57 +0000 |
---|---|---|
committer | diego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2009-05-13 02:58:57 +0000 |
commit | 6e9cbdc10448203e7c8b2de41447442fcc9f7bae (patch) | |
tree | 0ed465592509105fdbeab27fc12ddbb2e3590aa5 /stream/tcp.c | |
parent | eafe5b7517bbf408ae1ffc936a3abe2313c3b334 (diff) | |
download | mpv-6e9cbdc10448203e7c8b2de41447442fcc9f7bae.tar.bz2 mpv-6e9cbdc10448203e7c8b2de41447442fcc9f7bae.tar.xz |
whitespace cosmetics: Remove all trailing whitespace.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29305 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'stream/tcp.c')
-rw-r--r-- | stream/tcp.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/stream/tcp.c b/stream/tcp.c index ac3165b1a7..b299e9d66f 100644 --- a/stream/tcp.c +++ b/stream/tcp.c @@ -42,7 +42,7 @@ int network_prefer_ipv4 = 0; static const char *af2String(int af) { switch (af) { case AF_INET: return "AF_INET"; - + #ifdef HAVE_AF_INET6 case AF_INET6: return "AF_INET6"; #endif @@ -74,17 +74,17 @@ connect2Server_with_af(char *host, int port, int af,int verb) { void *our_s_addr; // Pointer to sin_addr or sin6_addr struct hostent *hp=NULL; char buf[255]; - + #if HAVE_WINSOCK2_H unsigned long val; int to; #else struct timeval to; #endif - + socket_server_fd = socket(af, SOCK_STREAM, 0); - - + + if( socket_server_fd==-1 ) { // mp_msg(MSGT_NETWORK,MSGL_ERR,"Failed to create %s socket:\n", af2String(af)); return TCP_ERROR_FATAL; @@ -111,10 +111,10 @@ connect2Server_with_af(char *host, int port, int af,int verb) { mp_msg(MSGT_NETWORK,MSGL_ERR, MSGTR_MPDEMUX_NW_UnknownAF, af); return TCP_ERROR_FATAL; } - - + + memset(&server_address, 0, sizeof(server_address)); - + #if HAVE_INET_PTON if (inet_pton(af, host, our_s_addr)!=1) #elif HAVE_INET_ATON @@ -124,7 +124,7 @@ connect2Server_with_af(char *host, int port, int af,int verb) { #endif { if(verb) mp_msg(MSGT_NETWORK,MSGL_STATUS,MSGTR_MPDEMUX_NW_ResolvingHostForAF, host, af2String(af)); - + #ifdef HAVE_GETHOSTBYNAME2 hp=(struct hostent*)gethostbyname2( host, af ); #else @@ -134,7 +134,7 @@ connect2Server_with_af(char *host, int port, int af,int verb) { if(verb) mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_NW_CantResolv, af2String(af), host); return TCP_ERROR_FATAL; } - + memcpy( our_s_addr, (void*)hp->h_addr_list[0], hp->h_length ); } #if HAVE_WINSOCK2_H @@ -143,14 +143,14 @@ connect2Server_with_af(char *host, int port, int af,int verb) { memcpy( our_s_addr, (void*)&addr, sizeof(addr) ); } #endif - + switch (af) { case AF_INET: server_address.four.sin_family=af; - server_address.four.sin_port=htons(port); + server_address.four.sin_port=htons(port); server_address_size = sizeof(server_address.four); break; -#ifdef HAVE_AF_INET6 +#ifdef HAVE_AF_INET6 case AF_INET6: server_address.six.sin6_family=af; server_address.six.sin6_port=htons(port); @@ -226,7 +226,7 @@ connect2Server_with_af(char *host, int port, int af,int verb) { mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_NW_ConnectError,strerror(err)); return TCP_ERROR_PORT; } - + return socket_server_fd; } @@ -241,15 +241,15 @@ connect2Server(char *host, int port, int verb) { int r; int s = TCP_ERROR_FATAL; - r = connect2Server_with_af(host, port, network_prefer_ipv4 ? AF_INET:AF_INET6,verb); + r = connect2Server_with_af(host, port, network_prefer_ipv4 ? AF_INET:AF_INET6,verb); if (r >= 0) return r; s = connect2Server_with_af(host, port, network_prefer_ipv4 ? AF_INET6:AF_INET,verb); if (s == TCP_ERROR_FATAL) return r; return s; -#else +#else return connect2Server_with_af(host, port, AF_INET,verb); #endif - + } |