diff options
author | des <des@FreeBSD.org> | 2014-01-28 14:32:04 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2014-01-28 14:32:04 +0000 |
commit | ec795122057b71761df5f7e3457db20311c6731e (patch) | |
tree | 5e71d698d9ec27820a7ba59f9c9222a07819d91d /usr.bin/fetch/fetch.c | |
parent | 2a7e8f70f573ed97d7dc6f4e06308270c6251972 (diff) | |
download | FreeBSD-src-ec795122057b71761df5f7e3457db20311c6731e.zip FreeBSD-src-ec795122057b71761df5f7e3457db20311c6731e.tar.gz |
Increase the default (and minimum) buffer size from 4 kB to 16 kB. Also,
propagate the buffer size to libc, which uses a 1 kB buffer by default,
negating any hypothetical benefit of increasing fetch(1)'s buffer size.
MFC after: 3 days
Diffstat (limited to 'usr.bin/fetch/fetch.c')
-rw-r--r-- | usr.bin/fetch/fetch.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.bin/fetch/fetch.c b/usr.bin/fetch/fetch.c index 3236431..3f64151 100644 --- a/usr.bin/fetch/fetch.c +++ b/usr.bin/fetch/fetch.c @@ -49,7 +49,7 @@ __FBSDID("$FreeBSD$"); #include <fetch.h> -#define MINBUFSIZE 4096 +#define MINBUFSIZE 16384 #define TIMEOUT 120 /* Option flags */ @@ -716,6 +716,7 @@ fetch(char *URL, const char *path) sigalrm = siginfo = sigint = 0; /* suck in the data */ + setvbuf(f, NULL, _IOFBF, B_size); signal(SIGINFO, sig_handler); while (!sigint) { if (us.size != -1 && us.size - count < B_size && |