]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 4432: assertion failed: store.cc:1919: "isEmpty()"
authorAlex Rousskov <rousskov@measurement-factory.com>
Thu, 18 Feb 2016 04:11:36 +0000 (21:11 -0700)
committerAlex Rousskov <rousskov@measurement-factory.com>
Thu, 18 Feb 2016 04:11:36 +0000 (21:11 -0700)
When we failed to parse a response:

* Do not use parsing leftovers, such as HTTP response status code. Doing
  so screws up error detection logic in continueAfterParsingHeader() and
  leads to stuck transactions instead of error responses.

* Do not store the fake half-baked response (via replaceHttpReply).
  Doing so leads to assertions.  The fake response is only meant for
  continueAfterParsingHeader().

I also removed a misleading XXX about connection closure. Our
continueAfterParsingHeader() handles errors, not processReplyHeader().

TODO: The error detection/propagation code is ugly and should be
rewritten [using C++ exceptions].

src/http.cc

index cf86f00a79fce57591050c5135c6d2bf8b8e3b32..e039cfbd46b91fcd344d2613178d38bc3e3cc23d 100644 (file)
@@ -726,13 +726,12 @@ HttpStateData::processReplyHeader()
 
         if (!parsedOk) {
             // unrecoverable parsing error
+            // TODO: Use Raw! XXX: inBuf no longer has the [beginning of the] malformed header.
             debugs(11, 3, "Non-HTTP-compliant header:\n---------\n" << inBuf << "\n----------");
             flags.headers_parsed = true;
             HttpReply *newrep = new HttpReply;
-            newrep->sline.set(Http::ProtocolVersion(), hp->messageStatus());
-            HttpReply *vrep = setVirginReply(newrep);
-            entry->replaceHttpReply(vrep);
-            // XXX: close the server connection ?
+            newrep->sline.set(Http::ProtocolVersion(), hp->parseStatusCode);
+            setVirginReply(newrep);
             ctx_exit(ctx);
             return;
         }