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].
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;
}