]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Handle all unknown HTTP/* as HTTP/0.9
authorAmos Jeffries <squid3@treenet.co.nz>
Mon, 2 Feb 2009 11:13:07 +0000 (00:13 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 2 Feb 2009 11:13:07 +0000 (00:13 +1300)
Assume that all requests are HTTP/0.9 unless explicity stated otherwise.
Drop assert on missing or overflow numeric cases.

src/HttpMsg.cc

index f2b48f047396eecfbcfb234f546725eaceb9c0e7..3ddbfbc19e3d0646c56ad7d0b20ed9080ac0ca91 100644 (file)
@@ -445,14 +445,16 @@ HttpParserRequestLen(HttpParser *hp)
 }
 #endif
 
-/*
+/**
  * Attempt to parse the request line.
  *
  * This will set the values in hmsg that it determines. One may end up
  * with a partially-parsed buffer; the return value tells you whether
  * the values are valid or not.
  *
- * @return 1 if parsed correctly, 0 if more is needed, -1 if error
+ * \retval     1 if parsed correctly
+ * \retval     0 if more is needed
+ * \retval     -1 if error
  *
  * TODO:
  *   * have it indicate "error" and "not enough" as two separate conditions!
@@ -463,7 +465,7 @@ HttpParserParseReqLine(HttpParser *hmsg)
 {
     int i = 0;
     int retcode = 0;
-    int maj = -1, min = -1;
+    unsigned int maj = 0, min = 9;
     int last_whitespace = -1, line_end = -1;
 
     debugs(74, 5, "httpParserParseReqLine: parsing " << hmsg->buf);
@@ -607,8 +609,6 @@ HttpParserParseReqLine(HttpParser *hmsg)
      * Rightio - we have all the schtuff. Return true; we've got enough.
      */
     retcode = 1;
-    assert(maj != -1);
-    assert(min != -1);
 
 finish:
     hmsg->v_maj = maj;