From: Alex Rousskov Date: Thu, 18 Feb 2016 04:11:36 +0000 (-0700) Subject: Bug 4432: assertion failed: store.cc:1919: "isEmpty()" X-Git-Tag: SQUID_4_0_7~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3d67f7e6f7c2c9c152a851a899f8ee01f9d7efec;p=thirdparty%2Fsquid.git Bug 4432: assertion failed: store.cc:1919: "isEmpty()" 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]. --- diff --git a/src/http.cc b/src/http.cc index cf86f00a79..e039cfbd46 100644 --- a/src/http.cc +++ b/src/http.cc @@ -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; }