Hiroki Sato 43092b7d08 Fix poor performance of ftp(1) due to small SO_SNDBUF and SO_RCVBUF.
ftp(1) from vendor/tnftp always tried the following for
every TCP connection:

1. Get the current buffer length of SO_SNDBUF and SO_RCVBUF
   by getsockopt(2).

2. Invoke setsockopt(2) to set them to the same values
   after checking if they are in a range between 8 KiB to 8 MiB.

This behavior broke dynamic buffer sizing enabled by
default (net.inet.tcp.{recv,send}buf_auto sysctls) and
led to a very poor transfer rate.  The fetch(1) utility
does not have this problem.

This change prevents SO_SNDBUF and SO_RCVBUF from configuring
when the buffer auto-sizing is enabled unless the buffer sizes are
explicitly specified.

PR:		240827
Spotted by:	Yuichiro NAITO
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D23732
2020-02-27 19:49:59 +00:00
..
2020-01-31 18:04:04 +00:00
2019-08-11 06:26:03 +00:00
2020-02-11 07:02:48 +00:00
2019-11-01 11:28:43 +00:00
2019-06-29 18:41:40 +00:00
2020-02-12 00:16:56 +00:00
2019-12-21 21:05:53 +00:00
2019-09-01 16:41:24 +00:00
2020-01-25 21:16:45 +00:00
2020-02-19 17:09:08 +00:00
2019-12-09 17:58:22 +00:00
2019-05-08 11:04:09 +00:00
2019-11-20 23:56:20 +00:00
2019-12-21 21:02:50 +00:00
2019-09-12 00:19:16 +00:00
2019-08-22 18:52:30 +00:00