diff options
author | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2009-07-07 02:26:13 +0300 |
---|---|---|
committer | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2009-07-07 02:34:35 +0300 |
commit | 0eb321bf2c1cc0e048faff26a01f86cdd3ec254f (patch) | |
tree | 71cb9bd9ed121156d3382066c0722c73189afe04 /stream/tcp.c | |
parent | 6d908205fbadbdf7ccdc6c5e0eb918f0b43f16e0 (diff) | |
download | mpv-0eb321bf2c1cc0e048faff26a01f86cdd3ec254f.tar.bz2 mpv-0eb321bf2c1cc0e048faff26a01f86cdd3ec254f.tar.xz |
Remove trailing whitespace from most files
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 e0f1795bf9..7566f5b309 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_tmsg(MSGT_NETWORK,MSGL_ERR, "Unknown address family %d\n", 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_tmsg(MSGT_NETWORK,MSGL_STATUS,"Resolving %s for %s...\n", 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_tmsg(MSGT_NETWORK,MSGL_ERR,"Couldn't resolve name for %s: %s\n", 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_tmsg(MSGT_NETWORK,MSGL_ERR,"connect error: %s\n",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 - + } |