From c1ba8c21113483903faf89089d61dc24cf44920d Mon Sep 17 00:00:00 2001 From: hniksic Date: Sat, 14 May 2005 12:24:22 -0700 Subject: [PATCH] [svn] Would forget to close the connection when keep_alive was not used. --- src/ChangeLog | 5 +++++ src/http.c | 22 ++++++++-------------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 1ed3c003..ced611bf 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2005-05-14 Hrvoje Niksic + + * http.c (gethttp): Would forget to close the connection when + keep_alive was not used. + 2005-05-13 Hrvoje Niksic * openssl.c (pattern_match): Document the code that decides diff --git a/src/http.c b/src/http.c index c6e83dec..b2027a93 100644 --- a/src/http.c +++ b/src/http.c @@ -1625,13 +1625,10 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy) if (statcode == HTTP_STATUS_UNAUTHORIZED) { /* Authorization is required. */ - if (keep_alive) - { - if (skip_short_body (sock, contlen)) - CLOSE_FINISH (sock); - else - CLOSE_INVALIDATE (sock); - } + if (keep_alive && skip_short_body (sock, contlen)) + CLOSE_FINISH (sock); + else + CLOSE_INVALIDATE (sock); pconn.authorized = 0; if (!auth_finished && (user && passwd)) { @@ -1768,13 +1765,10 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy) _("Location: %s%s\n"), hs->newloc ? escnonprint_uri (hs->newloc) : _("unspecified"), hs->newloc ? _(" [following]") : ""); - if (keep_alive) - { - if (skip_short_body (sock, contlen)) - CLOSE_FINISH (sock); - else - CLOSE_INVALIDATE (sock); - } + if (keep_alive && skip_short_body (sock, contlen)) + CLOSE_FINISH (sock); + else + CLOSE_INVALIDATE (sock); xfree_null (type); return NEWLOCATION; }