]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug #1142: fails to build with GCC-3.4.2 (FreeBSD and Linux)
authorhno <>
Sun, 12 Dec 2004 05:07:31 +0000 (05:07 +0000)
committerhno <>
Sun, 12 Dec 2004 05:07:31 +0000 (05:07 +0000)
This patch adds the != operator to HttpVersion

Also backs out the patch from Bug #1152.

src/HttpVersion.h
src/http.cc

index a33f74c9f08c2228c0757bd2fd8a986b386f5579..5df8d748ad8bb0f3d3285f75628484af121cdcbf 100644 (file)
@@ -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 */
index acd26f1117846dc0039b23ca38446357d93a1269..9906ec8ebbd6e11c5d862b9bcd640b94256a4978 100644 (file)
@@ -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);