From: Henrik Nordstrom Date: Thu, 5 Feb 2009 10:43:39 +0000 (+0100) Subject: Support HTTP/0.9 in accelerator mode X-Git-Tag: SQUID_3_2_0_1~1213 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=38e823820b23d0412ea67e0ffa7c56994e00260a;p=thirdparty%2Fsquid.git Support HTTP/0.9 in accelerator mode HTTP/0.9 requests do not have a HTTP header, fruitless to try to parse a non-existing header. Also send the right error page if header parsing fails (ERR_INVALID_REQ, not _URL) --- diff --git a/src/client_side.cc b/src/client_side.cc index e647a08137..0563fde385 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -2246,12 +2246,12 @@ clientProcessRequest(ConnStateData *conn, HttpParser *hp, ClientSocketContext *c /* compile headers */ /* we should skip request line! */ /* XXX should actually know the damned buffer size here */ - if (!request->parseHeader(HttpParserHdrBuf(hp), HttpParserHdrSz(hp))) { + if (http_ver.major >= 1 && !request->parseHeader(HttpParserHdrBuf(hp), HttpParserHdrSz(hp))) { clientStreamNode *node = context->getClientReplyContext(); debugs(33, 5, "Failed to parse request headers:\n" << HttpParserHdrBuf(hp)); clientReplyContext *repContext = dynamic_cast(node->data.getRaw()); assert (repContext); - repContext->setReplyToError(ERR_INVALID_URL, HTTP_BAD_REQUEST, method, http->uri, conn->peer, NULL, NULL, NULL); + repContext->setReplyToError(ERR_INVALID_REQ, HTTP_BAD_REQUEST, method, http->uri, conn->peer, NULL, NULL, NULL); assert(context->http->out.offset == 0); context->pullData(); conn->flags.readMoreRequests = false;