From: hniksic Date: Fri, 12 Dec 2003 22:40:39 +0000 (-0800) Subject: [svn] Don't fiddle with "interactive timeout" if read timeout is unset. X-Git-Tag: v1.13~1335 X-Git-Url: http://sjero.net/git/?p=wget;a=commitdiff_plain;h=9179f2e699cd0fbd5678e4b42a3072f1c2afa30c [svn] Don't fiddle with "interactive timeout" if read timeout is unset. --- diff --git a/src/ChangeLog b/src/ChangeLog index 59811c13..4de2bc22 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2003-12-12 Hrvoje Niksic + + * retr.c (fd_read_body): Don't fiddle with "interactive timeout" + if read timeout is unset. + 2003-12-12 Hrvoje Niksic * connect.c (bind_local): Don't set the IPV6_V6ONLY option on the diff --git a/src/retr.c b/src/retr.c index 308289ac..6ea558fa 100644 --- a/src/retr.c +++ b/src/retr.c @@ -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; + } } } }