]> sjero.net Git - wget/commitdiff
[svn] Doc update.
authorhniksic <devnull@localhost>
Mon, 22 Sep 2003 13:34:55 +0000 (06:34 -0700)
committerhniksic <devnull@localhost>
Mon, 22 Sep 2003 13:34:55 +0000 (06:34 -0700)
src/connect.c
src/retr.c

index f12225d8f9f5eece00477bc61bb74d9b97bb208c..8b8620daaa7bba1523b67fc350d0f796909853a0 100644 (file)
@@ -179,7 +179,8 @@ connect_to_one (ip_address *addr, unsigned short port, int silent)
 #ifdef SO_RCVBUF
   /* For very small rate limits, set the buffer size (and hence,
      hopefully, the size of the kernel window) to the size of the
-     limit.  */
+     limit.  That way we don't sleep for more than 1s between network
+     reads.  */
   if (opt.limit_rate && opt.limit_rate < 8192)
     {
       int bufsize = opt.limit_rate;
index 1af9a1b899ce6723cb328b4b8a0bfa5c49ac7f3e..3d8357fc252532eadea167d60bb6284872276194 100644 (file)
@@ -194,8 +194,10 @@ get_contents (int fd, FILE *fp, long *len, long restval, long expected,
     limit_bandwidth_reset ();
   wtimer_reset (timer);
 
-  /* If we're limiting the download, set our buffer size to the
-     limit.  */
+  /* Use a smaller buffer for low requested bandwidths.  For example,
+     with --limit-rate=2k, it doesn't make sense to slurp in 16K of
+     data and then sleep for 8s.  With buffer size equal to the limit,
+     we never have to sleep for more than one second.  */
   if (opt.limit_rate && opt.limit_rate < dlbufsize)
     dlbufsize = opt.limit_rate;