From: rousskov <> Date: Mon, 30 Mar 1998 13:56:24 +0000 (+0000) Subject: - Added STRICT_HTTP_PARSER pp directive to control parsing of invalid but X-Git-Tag: SQUID_3_0_PRE1~3700 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7518fce585d3a4922b8794893abbada844236dee;p=thirdparty%2Fsquid.git - Added STRICT_HTTP_PARSER pp directive to control parsing of invalid but commonly used HTTP formats. Currently the presense of "HTTP/" sequence in a GET request is affected. --- diff --git a/src/client_side.cc b/src/client_side.cc index 04f4bbe4f6..27818278af 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -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) {