1
0
mirror of https://github.com/moparisthebest/wget synced 2024-07-03 16:38:41 -04:00

[svn] Fixed a timeout problem in src/retr.c:fd_read_body when using http_proxy.

This commit is contained in:
mtortonesi 2004-11-18 13:05:30 -08:00
parent 1268028a0a
commit 14645396e2
4 changed files with 21 additions and 6 deletions

View File

@ -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.

View 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

View 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)

View 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)