]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Author: Henrik Nordstrom <henrik@henriknordstrom.net>
authorAmos Jeffries <squid3@treenet.co.nz>
Thu, 19 Feb 2009 02:26:30 +0000 (15:26 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Thu, 19 Feb 2009 02:26:30 +0000 (15:26 +1300)
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)

src/client_side.cc

index e6eb03ba291462375234645dd50e727ea8ff5f88..5290420bd871a972d0f152a59aac1f71fc448bc6 100755 (executable)
@@ -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<clientReplyContext *>(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();