Hi, Squid developers,

I'm using squid-3.1.19. I want to discuss the configuration directive
"tcp_recv_bufsize". I'm confused when seeing the code:

/* src/comm.cc */
1788 static void
1789 commSetTcpRcvbuf(int fd, int size)
1790 {
1791     if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, (char *) &size,
sizeof(size)) < 0)
1792         debugs(50, 1, "commSetTcpRcvbuf: FD " << fd << ", SIZE "
<< size << ": " << xstrerror());
1793     if (setsockopt(fd, SOL_SOCKET, SO_SNDBUF, (char *) &size,
sizeof(size)) < 0)
1794         debugs(50, 1, "commSetTcpRcvbuf: FD " << fd << ", SIZE "
<< size << ": " << xstrerror());
1795 #ifdef TCP_WINDOW_CLAMP
1796     if (setsockopt(fd, SOL_TCP, TCP_WINDOW_CLAMP, (char *) &size,
sizeof(size)) < 0)
1797         debugs(50, 1, "commSetTcpRcvbuf: FD " << fd << ", SIZE "
<< size << ": " << xstrerror());
1798 #endif
1799 }

Accoding to the code, when setting "tcp_recv_bufsize", Squid also set
the same amount as tcp_send_bufsize? And the send log printing message
(line# 1794) seems problematic because the failure is caused by
setting "tcp_send_bufsize" (the flag is SO_SNDBUF). If we really want
to set the send buffer size, why not add another directive?

Thanks a lot!
Tianyin

Reply via email to