]> sjero.net Git - wget/commitdiff
[svn] Fixed a timeout problem in src/retr.c:fd_read_body when using http_proxy.
authormtortonesi <devnull@localhost>
Thu, 18 Nov 2004 21:05:30 +0000 (13:05 -0800)
committermtortonesi <devnull@localhost>
Thu, 18 Nov 2004 21:05:30 +0000 (13:05 -0800)
ChangeLog
src/ChangeLog
src/connect.c
src/retr.c

index a8ea94916653a11343abeb95b77c213fb30d9ea4..a95f837e8909ffbd8d3538a4602302a7827a0fc2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,3 @@
-2004-11-15  YAMAZAKI Makoto <Yamazaki.Makoto@fujixerox.co.jp>
-
-       * src/netrc.c: Fix termination by assertion bug in netrc parsing.
-
 2004-05-09  David Fritz  <zeroxdf@att.net>
 
        * windows/Makefile.src.bor: Fix broken build rule.  Add clean target.
index b260efa42c124933dc1145f6334f82e1a7613ae8..2fc91b81c02c86bbebfd9c191d629b3086fc2834 100644 (file)
@@ -1,3 +1,15 @@
+2004-11-18  Mauro Tortonesi <mauro@deepspace6.net>
+
+       * connect.c: Minor correction to the comment in front of fd_peek.
+
+2004-11-18  Leonid Petrov <nouser@lpetrov.net>
+
+       * retr.c: Fix a timeout problem in fd_read_body when using http_proxy.
+
+2004-11-15  YAMAZAKI Makoto <Yamazaki.Makoto@fujixerox.co.jp>
+
+       * netrc.c: Fix termination by assertion bug in netrc parsing.
+
 2004-05-09  David Fritz  <zeroxdf@att.net>
 
        * mswindows.c (fake_fork): Pass entire command line to the child
index ffa33cc0427a859405e71ad067b13b449f523d1b..4963512a831a2718501b2fb3781f39ac6bb2ef4f 100644 (file)
@@ -873,8 +873,8 @@ fd_read (int fd, char *buf, int bufsize, double timeout)
     return sock_read (fd, buf, bufsize);
 }
 
-/* The same as xread, but don't actually read the data, just copy it
-   instead.  */
+/* The same as fd_read, but don't actually read the data, just find out
+   what's the number of bytes available for reading.  */
 
 int
 fd_peek (int fd, char *buf, int bufsize, double timeout)
index d9d03298a8eed084b62224ed3ee1102c44ac0c5e..605db8316e31bee892df334139c42cb8936f4306 100644 (file)
@@ -283,6 +283,13 @@ fd_read_body (int fd, FILE *out, long toread, long startpos,
        }
       ret = fd_read (fd, dlbuf, rdsize, tmout);
 
+      /* when retrieving from http-proxy wget sometimes does not trust the 
+       * file length reported by server.
+       * this check is to tell wget not to stubbornly try to read again and 
+       * again until another errno code was received. */
+      if ( ret == -1 && errno == ETIMEDOUT && sum_read == toread && toread > 0 )
+       break;
+
       if (ret == 0 || (ret < 0 && errno != ETIMEDOUT))
        break;                  /* read error */
       else if (ret < 0)