]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Print the "GOT HTTP REPLY HDR" message in HttpStateData::processReplyHeader()
authorwessels <>
Thu, 29 Dec 2005 04:43:13 +0000 (04:43 +0000)
committerwessels <>
Thu, 29 Dec 2005 04:43:13 +0000 (04:43 +0000)
*before* consuming the HTTP reply headers from readBuf.

Fixed NULL pointer bug in HttpStateData::doneAdapting().  Don't
delete icap before it might be needed.

src/http.cc

index 038b5a327b0d431d190167ba3b3a49d2ff8585de..bdda4350953b232632a65a22a57e0df6cc0371b0 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: http.cc,v 1.473 2005/12/22 23:09:09 wessels Exp $
+ * $Id: http.cc,v 1.474 2005/12/28 21:43:13 wessels Exp $
  *
  * DEBUG: section 11    Hypertext Transfer Protocol (HTTP)
  * AUTHOR: Harvest Derived
@@ -738,12 +738,12 @@ HttpStateData::processReplyHeader()
         return;
     }
 
-    readBuf->consume(headersEnd(readBuf->content(), readBuf->contentSize()));
-    flags.headers_parsed = 1;
-
     debug(11, 9) ("GOT HTTP REPLY HDR:\n---------\n%s\n----------\n",
                   readBuf->content());
 
+    readBuf->consume(headersEnd(readBuf->content(), readBuf->contentSize()));
+    flags.headers_parsed = 1;
+
     keepaliveAccounting(reply);
 
     checkDateSkew(reply);
@@ -2110,12 +2110,6 @@ HttpStateData::doneAdapting()
 {
     debug(11,5)("HttpStateData::doneAdapting() called\n");
 
-    /*
-     * ICAP is done, so we don't need this any more.
-     */
-    delete icap;
-    cbdataReferenceDone(icap);
-
     if (!entry->isAccepting()) {
         debug(11,5)("\toops, entry is not Accepting!\n");
         icap->ownerAbort();
@@ -2123,6 +2117,13 @@ HttpStateData::doneAdapting()
         fwdComplete(fwd);
     }
 
+    /*
+     * ICAP is done, so we don't need this any more.
+     */
+    delete icap;
+
+    cbdataReferenceDone(icap);
+
     if (fd >= 0)
         comm_close(fd);
     else