From: Amos Jeffries Date: Fri, 13 Aug 2010 15:36:39 +0000 (+1200) Subject: Fix build errors after merge X-Git-Tag: take08~55^2~124^2~86 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5ae21d99;p=thirdparty%2Fsquid.git Fix build errors after merge --- diff --git a/src/comm.cc b/src/comm.cc index bcbdfab41c..4eaf66a91c 100644 --- a/src/comm.cc +++ b/src/comm.cc @@ -214,7 +214,6 @@ static void commSetTcpNoDelay(int); #endif static void commSetTcpRcvbuf(int, int); static PF commHandleWrite; -static IPH commConnectDnsHandle; typedef enum { COMM_CB_READ = 1, @@ -850,27 +849,7 @@ comm_import_opened(int fd, */ } -static void -copyFDFlags(int to, fde *F) -{ - if (F->flags.close_on_exec) - commSetCloseOnExec(to); - - if (F->flags.nonblocking) - commSetNonBlocking(to); - -#ifdef TCP_NODELAY - - if (F->flags.nodelay) - commSetTcpNoDelay(to); - -#endif - - if (Config.tcpRcvBufsz > 0) - commSetTcpRcvbuf(to, Config.tcpRcvBufsz); -} - -/* +#if 0 int commSetTimeout_old(int fd, int timeout, PF * handler, void *data) { @@ -896,7 +875,7 @@ commSetTimeout_old(int fd, int timeout, PF * handler, void *data) return F->timeout; } -*/ +#endif int commSetTimeout(int fd, int timeout, PF * handler, void *data) diff --git a/src/comm/Connection.cc b/src/comm/Connection.cc index b6b1c849ed..34ef645189 100644 --- a/src/comm/Connection.cc +++ b/src/comm/Connection.cc @@ -26,7 +26,7 @@ Comm::Connection::~Connection() cbdataReferenceDone(_peer); } -Comm::ConnectionPointer & +Comm::ConnectionPointer Comm::Connection::copyDetails() const { ConnectionPointer c = new Comm::Connection; diff --git a/src/comm/Connection.h b/src/comm/Connection.h index 23209c3662..da1b651cff 100644 --- a/src/comm/Connection.h +++ b/src/comm/Connection.h @@ -84,7 +84,7 @@ public: /** Copy an existing connections IP and properties. * This excludes the FD. The new copy will be a closed connection. */ - ConnectionPointer & copyDetails() const; + ConnectionPointer copyDetails() const; /** Close any open socket. */ void close(); diff --git a/src/peer_select.cc b/src/peer_select.cc index 7a7234cd95..18ea8ac02f 100644 --- a/src/peer_select.cc +++ b/src/peer_select.cc @@ -59,7 +59,6 @@ static const char *DirectStr[] = { static void peerSelectFoo(ps_state *); static void peerPingTimeout(void *data); -static void peerSelectCallback(ps_state * psstate); static IRCB peerHandlePingReply; static void peerSelectStateFree(ps_state * psstate); static void peerIcpParentMiss(peer *, icp_common_t *, ps_state *); @@ -83,6 +82,15 @@ CBDATA_CLASS_INIT(ps_state); static void peerSelectStateFree(ps_state * psstate) { + if (psstate->entry) { + debugs(44, 3, HERE << psstate->entry->url()); + + if (psstate->entry->ping_status == PING_WAITING) + eventDelete(peerPingTimeout, psstate); + + psstate->entry->ping_status = PING_DONE; + } + if (psstate->acl_checklist) { debugs(44, 1, "calling aclChecklistFree() from peerSelectStateFree"); delete (psstate->acl_checklist); @@ -183,32 +191,6 @@ peerCheckAlwaysDirectDone(int answer, void *data) peerSelectFoo(psstate); } -static void -peerSelectCallback(ps_state * psstate) -{ - StoreEntry *entry = psstate->entry; - FwdServer *fs = psstate->servers; - - if (entry) { - debugs(44, 3, "peerSelectCallback: " << entry->url() ); - - if (entry->ping_status == PING_WAITING) - eventDelete(peerPingTimeout, psstate); - - entry->ping_status = PING_DONE; - } - - if (fs == NULL) { - debugs(44, 1, "Failed to select source for '" << entry->url() << "'" ); - debugs(44, 1, " always_direct = " << psstate->always_direct ); - debugs(44, 1, " never_direct = " << psstate->never_direct ); - debugs(44, 1, " timedout = " << psstate->ping.timedout ); - } - - psstate->ping.stop = current_time; - psstate->request->hier.ping = psstate->ping; -} - void peerSelectDnsPaths(ps_state *psstate) { @@ -227,7 +209,17 @@ peerSelectDnsPaths(ps_state *psstate) PSC *callback = psstate->callback; psstate->callback = NULL; - debugs(44, 2, "Found IP destination for: " << psstate->entry->url() << "'"); + if (psstate->paths->size() < 1) { + debugs(44, DBG_IMPORTANT, "Failed to select source for '" << psstate->entry->url() << "'" ); + debugs(44, DBG_IMPORTANT, " always_direct = " << psstate->always_direct ); + debugs(44, DBG_IMPORTANT, " never_direct = " << psstate->never_direct ); + debugs(44, DBG_IMPORTANT, " timedout = " << psstate->ping.timedout ); + } else { + debugs(44, 2, "Found IP destination for: " << psstate->entry->url() << "'"); + } + + psstate->ping.stop = current_time; + psstate->request->hier.ping = psstate->ping; void *cbdata; if (cbdataReferenceValidDone(psstate->callback_data, &cbdata)) {