mirror of
https://github.com/mirror/wget.git
synced 2025-03-12 18:50:18 +08:00
[svn] Invalidate socket if get_contents encountered an error.
Published in <sxsita54sqy.fsf@florida.arsdigita.de>.
This commit is contained in:
parent
90afc592e4
commit
cafe798fec
@ -1,3 +1,8 @@
|
|||||||
|
2002-01-14 Hrvoje Niksic <hniksic@arsdigita.com>
|
||||||
|
|
||||||
|
* http.c (gethttp): Invalidate SOCK if get_contents encountered an
|
||||||
|
error.
|
||||||
|
|
||||||
2001-12-24 Hrvoje Niksic <hniksic@arsdigita.com>
|
2001-12-24 Hrvoje Niksic <hniksic@arsdigita.com>
|
||||||
|
|
||||||
* version.c: Wget 1.8.1 is released.
|
* version.c: Wget 1.8.1 is released.
|
||||||
|
@ -1357,6 +1357,11 @@ Refusing to truncate existing file `%s'.\n\n"), *hs->local_file);
|
|||||||
(contlen != -1 ? contlen : 0),
|
(contlen != -1 ? contlen : 0),
|
||||||
&rbuf, keep_alive, &hs->dltime);
|
&rbuf, keep_alive, &hs->dltime);
|
||||||
|
|
||||||
|
if (hs->res >= 0)
|
||||||
|
CLOSE_FINISH (sock);
|
||||||
|
else
|
||||||
|
CLOSE_INVALIDATE (sock);
|
||||||
|
|
||||||
{
|
{
|
||||||
/* Close or flush the file. We have to be careful to check for
|
/* Close or flush the file. We have to be careful to check for
|
||||||
error here. Checking the result of fwrite() is not enough --
|
error here. Checking the result of fwrite() is not enough --
|
||||||
@ -1370,7 +1375,6 @@ Refusing to truncate existing file `%s'.\n\n"), *hs->local_file);
|
|||||||
hs->res = -2;
|
hs->res = -2;
|
||||||
}
|
}
|
||||||
FREE_MAYBE (all_headers);
|
FREE_MAYBE (all_headers);
|
||||||
CLOSE_FINISH (sock);
|
|
||||||
if (hs->res == -2)
|
if (hs->res == -2)
|
||||||
return FWRITEERR;
|
return FWRITEERR;
|
||||||
return RETRFINISHED;
|
return RETRFINISHED;
|
||||||
|
Loading…
Reference in New Issue
Block a user