]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
- Added STRICT_HTTP_PARSER pp directive to control parsing of invalid but
authorrousskov <>
Mon, 30 Mar 1998 13:56:24 +0000 (13:56 +0000)
committerrousskov <>
Mon, 30 Mar 1998 13:56:24 +0000 (13:56 +0000)
  commonly used HTTP formats. Currently the presense of "HTTP/" sequence in a
  GET request is affected.

src/client_side.cc

index 04f4bbe4f69c5acb4e5e033a744e6d74bf20f709..27818278af39f45763fd685923843154f72a4ec0 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side.cc,v 1.238 1998/03/28 23:24:43 wessels Exp $
+ * $Id: client_side.cc,v 1.239 1998/03/30 06:56:24 rousskov Exp $
  *
  * DEBUG: section 33    Client-side Routines
  * AUTHOR: Duane Wessels
@@ -1530,6 +1530,7 @@ parseHttpRequest(ConnStateData * conn, method_t * method_p, int *status,
     for (t = token; t && *t && *t != '\n' && *t != '\r'; t++);
     if (t == NULL || *t == '\0' || t == token || strncmp(token, "HTTP/", 5)) {
        debug(33, 3) ("parseHttpRequest: Missing HTTP identifier\n");
+#if STRICT_HTTP_PARSER
        http = xcalloc(1, sizeof(clientHttpRequest));
        cbdataAdd(http, MEM_NONE);
        http->conn = conn;
@@ -1541,8 +1542,11 @@ parseHttpRequest(ConnStateData * conn, method_t * method_p, int *status,
        *headers_p = inbuf;
        *status = -1;
        return http;
-    }
-    http_ver = (float) atof(token + 5);
+#else
+       http_ver = (float) 0.9; /* wild guess */
+#endif
+    } else
+       http_ver = (float) atof(token + 5);
 
     /* Check if headers are received */
     if ((end = mime_headers_end(t)) == NULL) {