From: Amos Jeffries Date: Thu, 19 Feb 2009 02:26:30 +0000 (+1300) Subject: Author: Henrik Nordstrom X-Git-Tag: SQUID_3_0_STABLE14~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a9abc2bedb669a9f98afb1ec174c111187836ab3;p=thirdparty%2Fsquid.git Author: Henrik Nordstrom 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 e6eb03ba29..5290420bd8 100755 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -2190,13 +2190,13 @@ clientProcessRequest(ConnStateData::Pointer &conn, HttpParser *hp, ClientSocketC /* 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, + ERR_INVALID_REQ, HTTP_BAD_REQUEST, method, http->uri, &conn->peer.sin_addr, NULL, NULL, NULL); assert(context->http->out.offset == 0); context->pullData();