]> sjero.net Git - wget/commitdiff
[svn] Don't fiddle with "interactive timeout" if read timeout is unset.
authorhniksic <devnull@localhost>
Fri, 12 Dec 2003 22:40:39 +0000 (14:40 -0800)
committerhniksic <devnull@localhost>
Fri, 12 Dec 2003 22:40:39 +0000 (14:40 -0800)
src/ChangeLog
src/retr.c

index 59811c131e774b755f9d8fb4cfa34a444dadf9f8..4de2bc220e94f56fa27896c3a7e0c6af0dd9a1cb 100644 (file)
@@ -1,3 +1,8 @@
+2003-12-12  Hrvoje Niksic  <hniksic@xemacs.org>
+
+       * retr.c (fd_read_body): Don't fiddle with "interactive timeout"
+       if read timeout is unset.
+
 2003-12-12  Hrvoje Niksic  <hniksic@xemacs.org>
 
        * connect.c (bind_local): Don't set the IPV6_V6ONLY option on the
index 308289ac3378ba351a81ee5514351b666eee06c6..6ea558fa49a36eb79e01695a114777df4c46169c 100644 (file)
@@ -259,21 +259,24 @@ fd_read_body (int fd, FILE *out, long toread, long startpos,
       double tmout = opt.read_timeout;
       if (progress_interactive)
        {
-         double waittm;
          /* For interactive progress gauges, always specify a ~1s
             timeout, so that the gauge can be updated regularly even
             when the data arrives very slowly or stalls.  */
          tmout = 0.95;
-         waittm = (wtimer_read (timer) - last_successful_read_tm) / 1000;
-         if (waittm + tmout > opt.read_timeout)
+         if (opt.read_timeout)
            {
-             /* Don't let total idle time exceed read timeout. */
-             tmout = opt.read_timeout - waittm;
-             if (tmout < 0)
+             double waittm;
+             waittm = (wtimer_read (timer) - last_successful_read_tm) / 1000;
+             if (waittm + tmout > opt.read_timeout)
                {
-                 /* We've already exceeded the timeout. */
-                 ret = -1, errno = ETIMEDOUT;
-                 break;
+                 /* Don't let total idle time exceed read timeout. */
+                 tmout = opt.read_timeout - waittm;
+                 if (tmout < 0)
+                   {
+                     /* We've already exceeded the timeout. */
+                     ret = -1, errno = ETIMEDOUT;
+                     break;
+                   }
                }
            }
        }