]> sjero.net Git - wget/commitdiff
Avoid a small buffer when retrieving a file.
authorGiuseppe Scrivano <gscrivano@gnu.org>
Mon, 23 May 2011 18:27:42 +0000 (20:27 +0200)
committerGiuseppe Scrivano <gscrivano@gnu.org>
Mon, 23 May 2011 18:27:42 +0000 (20:27 +0200)
src/ChangeLog
src/retr.c

index 56d6def4b2c339a677088e3356657fe077ebb0ae..c88740b51442400a72f85e23da0c886a027daccc 100644 (file)
@@ -1,5 +1,9 @@
 2011-05-23  Giuseppe Scrivano  <gscrivano@gnu.org>
 
+       * retr.c (fd_read_body): Be sure the buffer size is at least 8Kb.
+       BUFSIZ may assume very small values with a negative impact on the
+       performances.
+
        * mswindows.h [NEED_GAI_STRERROR]: remove definition for gai_strerror.
 
 2011-05-15  Ray Satiro <raysatiro@yahoo.com>
index 25c5dcf4440e11da851db0e3101d48ead723aa8b..585cccb68f34ab8777b3d7c336b1791f89e3e2f4 100644 (file)
@@ -208,8 +208,8 @@ fd_read_body (int fd, FILE *out, wgint toread, wgint startpos,
 {
   int ret = 0;
 
-  int dlbufsize = BUFSIZ;
-  char *dlbuf = xmalloc (BUFSIZ);
+  int dlbufsize = max (BUFSIZ, 8 * 1024);
+  char *dlbuf = xmalloc (dlbufsize);
 
   struct ptimer *timer = NULL;
   double last_successful_read_tm = 0;