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

[svn] Committed my patch that makes HTTP code close its socket in premature

returns (before the body was drained).  Published in
<sxsd7ayn0kt.fsf@florida.arsdigita.de>.
This commit is contained in:
hniksic 2001-03-30 18:20:16 -08:00
parent 728584d072
commit 8f048b7be8
2 changed files with 13 additions and 4 deletions

View File

@ -1,3 +1,8 @@
2001-03-31 Hrvoje Niksic <hniksic@arsdigita.com>
* http.c (gethttp): Make sure the socket is closed with
CLOSE_INVALIDATE before we have drained the body.
2001-03-31 Hrvoje Niksic <hniksic@arsdigita.com>
* retr.c (retrieve_url): Call register_download() for downloaded

View File

@ -1060,7 +1060,8 @@ Accept: %s\r\n\
FREE_MAYBE (type);
type = NULL;
FREEHSTAT (*hs);
CLOSE_FINISH (sock);
CLOSE_INVALIDATE (sock); /* would be CLOSE_FINISH, but there
might be more bytes in the body. */
if (auth_tried_already)
{
/* If we have tried it already, then there is not point
@ -1166,7 +1167,8 @@ Accept: %s\r\n\
_("Location: %s%s\n"),
hs->newloc ? hs->newloc : _("unspecified"),
hs->newloc ? _(" [following]") : "");
CLOSE_FINISH (sock);
CLOSE_INVALIDATE (sock); /* would be CLOSE_FINISH, but there
might be more bytes in the body. */
FREE_MAYBE (type);
FREE_MAYBE (all_headers);
return NEWLOCATION;
@ -1207,7 +1209,8 @@ Accept: %s\r\n\
hs->res = 0;
FREE_MAYBE (type);
FREE_MAYBE (all_headers);
CLOSE_FINISH (sock);
CLOSE_INVALIDATE (sock); /* would be CLOSE_FINISH, but there
might be more bytes in the body. */
return RETRFINISHED;
}
@ -1221,7 +1224,8 @@ Accept: %s\r\n\
if (!fp)
{
logprintf (LOG_NOTQUIET, "%s: %s\n", u->local, strerror (errno));
CLOSE_FINISH (sock);
CLOSE_INVALIDATE (sock); /* would be CLOSE_FINISH, but there
might be more bytes in the body. */
FREE_MAYBE (all_headers);
return FOPENERR;
}