mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Let automatic TCP send buffer sizing do its job for ftpd(8): stop
setting the SO_SNDBUF socket option. Using a hard-coded value for it was a poor idea anyway in the face of diverse network conditions.
This commit is contained in:
parent
a2d605f78c
commit
32072720cb
1 changed files with 1 additions and 9 deletions
|
|
@ -1871,20 +1871,12 @@ getdatasock(char *mode)
|
|||
#ifdef TCP_NOPUSH
|
||||
/*
|
||||
* Turn off push flag to keep sender TCP from sending short packets
|
||||
* at the boundaries of each write(). Should probably do a SO_SNDBUF
|
||||
* to set the send buffer size as well, but that may not be desirable
|
||||
* in heavy-load situations.
|
||||
* at the boundaries of each write().
|
||||
*/
|
||||
on = 1;
|
||||
if (setsockopt(s, IPPROTO_TCP, TCP_NOPUSH, &on, sizeof on) < 0)
|
||||
syslog(LOG_WARNING, "data setsockopt (TCP_NOPUSH): %m");
|
||||
#endif
|
||||
#ifdef SO_SNDBUF
|
||||
on = 65536;
|
||||
if (setsockopt(s, SOL_SOCKET, SO_SNDBUF, &on, sizeof on) < 0)
|
||||
syslog(LOG_WARNING, "data setsockopt (SO_SNDBUF): %m");
|
||||
#endif
|
||||
|
||||
return (fdopen(s, mode));
|
||||
bad:
|
||||
/* Return the real value of errno (close may change it) */
|
||||
|
|
|
|||
Loading…
Reference in a new issue