From 8f048b7be87a2db8a9265da5620c0fd9087768f9 Mon Sep 17 00:00:00 2001 From: hniksic Date: Fri, 30 Mar 2001 18:20:16 -0800 Subject: [PATCH] [svn] Committed my patch that makes HTTP code close its socket in premature returns (before the body was drained). Published in . --- src/ChangeLog | 5 +++++ src/http.c | 12 ++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 7d6cb1da..2151a0b3 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2001-03-31 Hrvoje Niksic + + * http.c (gethttp): Make sure the socket is closed with + CLOSE_INVALIDATE before we have drained the body. + 2001-03-31 Hrvoje Niksic * retr.c (retrieve_url): Call register_download() for downloaded diff --git a/src/http.c b/src/http.c index 9911a5e1..624e411f 100644 --- a/src/http.c +++ b/src/http.c @@ -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; }