From: hno <> Date: Fri, 24 Aug 2007 23:56:45 +0000 (+0000) Subject: Make tcp_recv_bufsize apply to send buffers as well, in an attempt to control window... X-Git-Tag: SQUID_3_0_PRE7~31 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8f0d53ef7846093aa54e7fcaaf3c495f63f3d2a6;p=thirdparty%2Fsquid.git Make tcp_recv_bufsize apply to send buffers as well, in an attempt to control window scaling the main reason to set tcp_recv_bufsize is to avoid problems related to large windows. For example many firewalls still have problems with window scaling. this change makes the option apply to send buffers as well, and also hints Linux that Squid will never increase the buffer so the window scaling should be clamped to the indicated buffer size. --- diff --git a/src/comm.cc b/src/comm.cc index 134924e883..11d98d7df6 100644 --- a/src/comm.cc +++ b/src/comm.cc @@ -1,6 +1,6 @@ /* - * $Id: comm.cc,v 1.434 2007/08/11 12:13:26 serassio Exp $ + * $Id: comm.cc,v 1.435 2007/08/24 17:56:45 hno Exp $ * * DEBUG: section 5 Socket Functions * AUTHOR: Harvest Derived @@ -1698,6 +1698,12 @@ commSetTcpRcvbuf(int fd, int size) { if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, (char *) &size, sizeof(size)) < 0) debugs(50, 1, "commSetTcpRcvbuf: FD " << fd << ", SIZE " << size << ": " << xstrerror()); + if (setsockopt(fd, SOL_SOCKET, SO_SNDBUF, (char *) &size, sizeof(size)) < 0) + debugs(50, 1, "commSetTcpRcvbuf: FD " << fd << ", SIZE " << size << ": " << xstrerror()); +#ifdef TCP_WINDOW_CLAMP + if (setsockopt(fd, SOL_TCP, TCP_WINDOW_CLAMP, (char *) &size, sizeof(size)) < 0) + debugs(50, 1, "commSetTcpRcvbuf: FD " << fd << ", SIZE " << size << ": " << xstrerror()); +#endif } int