#include "base/TextException.h"
#include "ChunkedCodingParser.h"
#include "comm.h"
+#include "comm/Connection.h"
#include "HttpMsg.h"
#include "HttpRequest.h"
#include "HttpReply.h"
void Adaptation::Icap::ModXact::startReading()
{
- Must(connection >= 0);
+ Must(connection != NULL && connection->isOpen());
Must(!reader);
Must(!adapted.header);
Must(!adapted.body_pipe);
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())
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)
#include "squid.h"
#include "comm.h"
+#include "comm/Connection.h"
#include "comm/ConnectStateData.h"
#include "CommCalls.h"
#include "HttpMsg.h"
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;
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);
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.