]> sjero.net Git - wget/commitdiff
[svn] Committed my patch that makes HTTP code close its socket in premature
authorhniksic <devnull@localhost>
Sat, 31 Mar 2001 02:20:16 +0000 (18:20 -0800)
committerhniksic <devnull@localhost>
Sat, 31 Mar 2001 02:20:16 +0000 (18:20 -0800)
returns (before the body was drained).  Published in
<sxsd7ayn0kt.fsf@florida.arsdigita.de>.

src/ChangeLog
src/http.c

index 7d6cb1da552726fdaaab19a2ea4b4c0a570fbf58..2151a0b3be78e91f834bb90fe3ede9fd4322f25d 100644 (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
index 9911a5e16e61bf1e6115d42a29f8760c02251422..624e411fce7f82ea438587979898897da811d6db 100644 (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;
        }