Index: httptunnel-3.3+dfsg/tunnel.c =================================================================== --- httptunnel-3.3+dfsg.orig/tunnel.c 2000-09-01 04:46:10.000000000 -0400 +++ httptunnel-3.3+dfsg/tunnel.c 2015-11-05 23:44:44.992730816 -0500 @@ -140,30 +140,25 @@ tunnel_in_setsockopts (int fd) { #ifdef SO_RCVLOWAT - int tcp = get_proto_number ("tcp"); + int i, n; - if (tcp != -1) - { - int i, n; - - i = 1; - if (setsockopt (fd, - tcp, - SO_RCVLOWAT, - (void *)&i, - sizeof i) == -1) - { - log_debug ("tunnel_in_setsockopts: non-fatal SO_RCVLOWAT error: %s", - strerror (errno)); - } - n = sizeof i; - getsockopt (fd, - tcp, - SO_RCVLOWAT, - (void *)&i, - &n); - log_debug ("tunnel_out_setsockopts: SO_RCVLOWAT: %d", i); - } + i = 1; + if (setsockopt (fd, + SOL_SOCKET, + SO_RCVLOWAT, + (void *)&i, + sizeof i) == -1) + { + log_debug ("tunnel_in_setsockopts: non-fatal SO_RCVLOWAT error: %s", + strerror (errno)); + } + n = sizeof i; + getsockopt (fd, + SOL_SOCKET, + SO_RCVLOWAT, + (void *)&i, + &n); + log_debug ("tunnel_in_setsockopts: SO_RCVLOWAT: %d", i); #endif /* SO_RCVLOWAT */ return 0; @@ -174,30 +169,26 @@ { #ifdef SO_SNDLOWAT { - int tcp = get_proto_number ("tcp"); int i, n; - - if (tcp != -1) - { - i = 1; - if (setsockopt (fd, - tcp, - SO_SNDLOWAT, - (void *)&i, - sizeof i) == -1) - { - log_debug ("tunnel_out_setsockopts: " - "non-fatal SO_SNDLOWAT error: %s", - strerror (errno)); - } - n = sizeof i; - getsockopt (fd, - tcp, - SO_SNDLOWAT, - (void *)&i, - &n); - log_debug ("tunnel_out_setsockopts: non-fatal SO_SNDLOWAT: %d", i); - } + + i = 1; + if (setsockopt (fd, + SOL_SOCKET, + SO_SNDLOWAT, + (void *)&i, + sizeof i) == -1) + { + log_debug ("tunnel_out_setsockopts: " + "non-fatal SO_SNDLOWAT error: %s", + strerror (errno)); + } + n = sizeof i; + getsockopt (fd, + SOL_SOCKET, + SO_SNDLOWAT, + (void *)&i, + &n); + log_debug ("tunnel_out_setsockopts: non-fatal SO_SNDLOWAT: %d", i); } #endif /* SO_SNDLOWAT */ @@ -232,7 +223,7 @@ { int tcp = get_proto_number ("tcp"); int i, n; - + if (tcp != -1) { i = 1; @@ -538,7 +529,7 @@ { char c = TUNNEL_PAD1; int i; - + for (i=0; ibytes > tunnel->content_length) log_debug ("tunnel_write_request: tunnel->bytes > tunnel->content_length"); #endif - + if (tunnel->bytes >= tunnel->content_length) { char c = TUNNEL_DISCONNECT; @@ -1088,7 +1079,7 @@ while (tunnel->in_fd == -1 || tunnel->out_fd == -1) { - struct sockaddr_in addr; + struct sockaddr_in addr; Http_request *request; struct pollfd p; ssize_t m; @@ -1308,7 +1299,7 @@ Tunnel *tunnel; log_verbose ("tunnel_new_client (\"%s\", %d, \"%s\", %d, %d)", - host, host_port, proxy ? proxy : "(null)", proxy_port, + host, host_port, proxy ? proxy : "(null)", proxy_port, content_length); tunnel = malloc (sizeof (Tunnel));