From: Amos Jeffries Date: Thu, 10 Jun 2010 12:26:22 +0000 (+1200) Subject: Fix some new build issues X-Git-Tag: take08~55^2~124^2~129 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d632701767eb5bf6e68280b70dfe107d9c0d4641;p=thirdparty%2Fsquid.git Fix some new build issues --- diff --git a/src/adaptation/icap/ModXact.cc b/src/adaptation/icap/ModXact.cc index fcdbc2fa9c..1b47fd91bf 100644 --- a/src/adaptation/icap/ModXact.cc +++ b/src/adaptation/icap/ModXact.cc @@ -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) diff --git a/src/adaptation/icap/Xaction.cc b/src/adaptation/icap/Xaction.cc index 094774d864..4d5bed63c3 100644 --- a/src/adaptation/icap/Xaction.cc +++ b/src/adaptation/icap/Xaction.cc @@ -4,6 +4,7 @@ #include "squid.h" #include "comm.h" +#include "comm/Connection.h" #include "comm/ConnectStateData.h" #include "CommCalls.h" #include "HttpMsg.h" diff --git a/src/comm/Connection.h b/src/comm/Connection.h index e8f587b005..5b35f79289 100644 --- a/src/comm/Connection.h +++ b/src/comm/Connection.h @@ -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; diff --git a/src/peer_select.cc b/src/peer_select.cc index 6d0d7d06ca..a61faa8e6b 100644 --- a/src/peer_select.cc +++ b/src/peer_select.cc @@ -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.