From: Automatic source maintenance Date: Tue, 3 Nov 2009 01:12:56 +0000 (-0700) Subject: SourceFormat Enforcement X-Git-Tag: SQUID_3_2_0_1~625 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dd20bfd31f0b70a34ef65ed6fd9d84d88af87865;p=thirdparty%2Fsquid.git SourceFormat Enforcement --- diff --git a/src/HttpReply.cc b/src/HttpReply.cc index b12e144e4a..72b29313d3 100644 --- a/src/HttpReply.cc +++ b/src/HttpReply.cc @@ -464,8 +464,7 @@ HttpReply::sanityCheckStartLine(MemBuf *buf, const size_t hdr_len, http_status * if (strncmp(buf->content(), "ICY", 3) == 0) { protoPrefix = "ICY"; pos = protoPrefix.psize(); - } - else { + } else { if (protoPrefix.cmp(buf->content(), protoPrefix.size()) != 0) { debugs(58, 3, "HttpReply::sanityCheckStartLine: missing protocol prefix (" << protoPrefix << ") in '" << buf->content() << "'"); @@ -475,7 +474,7 @@ HttpReply::sanityCheckStartLine(MemBuf *buf, const size_t hdr_len, http_status * // catch missing or negative status value (negative '-' is not a digit) pos = protoPrefix.psize(); - + // skip arbitrary number of digits and a dot in the verion portion while ( pos <= buf->contentSize() && (*(buf->content()+pos) == '.' || xisdigit(*(buf->content()+pos)) ) ) ++pos; diff --git a/src/HttpStatusLine.cc b/src/HttpStatusLine.cc index e221d148ff..63e5402064 100644 --- a/src/HttpStatusLine.cc +++ b/src/HttpStatusLine.cc @@ -110,8 +110,7 @@ httpStatusLineParse(HttpStatusLine * sline, const String &protoPrefix, const cha debugs(57, 3, "httpStatusLineParse: Invalid HTTP identifier. Detected ICY protocol istead."); sline->protocol = PROTO_ICY; start += protoPrefix.size(); - } - else if (protoPrefix.caseCmp(start, protoPrefix.size()) == 0) { + } else if (protoPrefix.caseCmp(start, protoPrefix.size()) == 0) { start += protoPrefix.size(); @@ -121,8 +120,7 @@ httpStatusLineParse(HttpStatusLine * sline, const String &protoPrefix, const cha if (sscanf(start, "%d.%d", &sline->version.major, &sline->version.minor) != 2) { debugs(57, 7, "httpStatusLineParse: Invalid HTTP identifier."); } - } - else + } else return 0; if (!(start = strchr(start, ' ')))