]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix some new build issues
authorAmos Jeffries <squid3@treenet.co.nz>
Thu, 10 Jun 2010 12:26:22 +0000 (00:26 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Thu, 10 Jun 2010 12:26:22 +0000 (00:26 +1200)
src/adaptation/icap/ModXact.cc
src/adaptation/icap/Xaction.cc
src/comm/Connection.h
src/peer_select.cc

index fcdbc2fa9ca38b07cfaea9c0edac90a9c3b9c685..1b47fd91bf24c4e4ed50c015ac638541391718d7 100644 (file)
@@ -16,6 +16,7 @@
 #include "base/TextException.h"
 #include "ChunkedCodingParser.h"
 #include "comm.h"
+#include "comm/Connection.h"
 #include "HttpMsg.h"
 #include "HttpRequest.h"
 #include "HttpReply.h"
@@ -463,7 +464,7 @@ bool Adaptation::Icap::ModXact::doneAll() const
 
 void Adaptation::Icap::ModXact::startReading()
 {
-    Must(connection >= 0);
+    Must(connection != NULL && connection->isOpen());
     Must(!reader);
     Must(!adapted.header);
     Must(!adapted.body_pipe);
@@ -621,7 +622,7 @@ void Adaptation::Icap::ModXact::bypassFailure()
     stopParsing();
 
     stopWriting(true); // or should we force it?
-    if (connection >= 0) {
+    if (connection != NULL && connection->isOpen()) {
         reuseConnection = false; // be conservative
         cancelRead(); // may not work; and we cannot stop connecting either
         if (!doneWithIo())
@@ -1441,7 +1442,7 @@ void Adaptation::Icap::ModXact::fillPendingStatus(MemBuf &buf) const
     if (virgin.body_pipe != NULL)
         buf.append("R", 1);
 
-    if (connection > 0 && !doneReading())
+    if (connection != NULL && connection->isOpen() && !doneReading())
         buf.append("r", 1);
 
     if (!state.doneWriting() && state.writing != State::writingInit)
index 094774d8643209cccf517b4a1b6552221e7f2713..4d5bed63c38f59dd845294413f35589fb410c36f 100644 (file)
@@ -4,6 +4,7 @@
 
 #include "squid.h"
 #include "comm.h"
+#include "comm/Connection.h"
 #include "comm/ConnectStateData.h"
 #include "CommCalls.h"
 #include "HttpMsg.h"
index e8f587b0050f5c6a78028e8b21c5e14338ef1e7d..5b35f79289b87ed94c80a7a9d1a46a529239045f 100644 (file)
@@ -91,7 +91,7 @@ public:
     void close();
 
     /** determine whether this object describes an active connection or not. */
-    bool isOpen() { return (fd >= 0); }
+    bool isOpen() const { return (fd >= 0); }
 
     /** Address/Port for the Squid end of a TCP link. */
     Ip::Address local;
index 6d0d7d06ca4aa3e41f6d4ef88505a42b8c2d47ae..a61faa8e6b86969b9bce05e3d90390be6cf87291 100644 (file)
@@ -215,7 +215,7 @@ peerSelectDnsPaths(ps_state *psstate)
     FwdServer *fs = psstate->servers;
 
     // convert the list of FwdServer destinations into destinations IP addresses
-    if (fs && psstate->paths->size() < Config.forward_max_tries) {
+    if (fs && psstate->paths->size() < (unsigned int)Config.forward_max_tries) {
         // send the next one off for DNS lookup.
         const char *host = fs->_peer ? fs->_peer->host : psstate->request->GetHost();
         debugs(44, 2, "Find IP destination for: " << psstate->entry->url() << "' via " << host);
@@ -256,7 +256,7 @@ peerSelectDnsResults(const ipcache_addrs *ia, const DnsLookupDetails &details, v
             if (ip >= ia->count) ip = 0; // looped back to zero.
 
             // Enforce forward_max_tries configuration.
-            if (psstate->paths->paths() >= Config.forward_max_tries)
+            if (psstate->paths->size() >= (unsigned int)Config.forward_max_tries)
                 break;
 
             // for TPROXY we must skip unusable addresses.