From: hno <> Date: Sun, 12 Dec 2004 05:07:31 +0000 (+0000) Subject: Bug #1142: fails to build with GCC-3.4.2 (FreeBSD and Linux) X-Git-Tag: SQUID_3_0_PRE4~981 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b735b90c04318a363e85f52b38f3850b28b36c95;p=thirdparty%2Fsquid.git Bug #1142: fails to build with GCC-3.4.2 (FreeBSD and Linux) This patch adds the != operator to HttpVersion Also backs out the patch from Bug #1152. --- diff --git a/src/HttpVersion.h b/src/HttpVersion.h index a33f74c9f0..5df8d748ad 100644 --- a/src/HttpVersion.h +++ b/src/HttpVersion.h @@ -1,6 +1,6 @@ /* - * $Id: HttpVersion.h,v 1.2 2004/11/16 23:11:46 wessels Exp $ + * $Id: HttpVersion.h,v 1.3 2004/12/11 22:07:31 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -65,6 +65,11 @@ public: return true; } + bool operator!=(const HttpVersion& that) const + { + return ((this->major != that.major) || (this->minor != that.minor)); + } + }; #endif /* SQUID_HTTPVERSION_H */ diff --git a/src/http.cc b/src/http.cc index acd26f1117..9906ec8ebb 100644 --- a/src/http.cc +++ b/src/http.cc @@ -1,6 +1,6 @@ /* - * $Id: http.cc,v 1.437 2004/12/10 00:55:15 hno Exp $ + * $Id: http.cc,v 1.438 2004/12/11 22:07:31 hno Exp $ * * DEBUG: section 11 Hypertext Transfer Protocol (HTTP) * AUTHOR: Harvest Derived @@ -988,7 +988,7 @@ HttpStateData::readReply (int fd, char *readBuf, size_t len, comm_err_t flag, in */ /* doesn't return */ processReplyHeader(buf, len); - else if (entry->getReply()->sline.status == HTTP_INVALID_HEADER && !(HttpVersion(0,9) == entry->getReply()->sline.version)) { + else if (entry->getReply()->sline.status == HTTP_INVALID_HEADER && HttpVersion(0,9) != entry->getReply()->sline.version) { ErrorState *err; err = errorCon(ERR_INVALID_REQ, HTTP_BAD_GATEWAY); err->request = requestLink((HttpRequest *) request); @@ -1007,7 +1007,7 @@ HttpStateData::readReply (int fd, char *readBuf, size_t len, comm_err_t flag, in http_status s = entry->getReply()->sline.status; HttpVersion httpver = entry->getReply()->sline.version; - if (s == HTTP_INVALID_HEADER && !(httpver == HttpVersion(0,9))) { + if (s == HTTP_INVALID_HEADER && httpver != HttpVersion(0,9)) { ErrorState *err; storeEntryReset(entry); err = errorCon(ERR_INVALID_REQ, HTTP_BAD_GATEWAY);