]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix build errors after merge
authorAmos Jeffries <squid3@treenet.co.nz>
Fri, 13 Aug 2010 15:36:39 +0000 (03:36 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 13 Aug 2010 15:36:39 +0000 (03:36 +1200)
src/comm.cc
src/comm/Connection.cc
src/comm/Connection.h
src/peer_select.cc

index bcbdfab41c0e1a5ba2c127ad5e242dc46c4f3f65..4eaf66a91c1be8d20ea8c05bc277481cec799b6c 100644 (file)
@@ -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)
index b6b1c849edfa0976cea865b113d90eb557542e64..34ef64518939af5eb9bc75ba800253df3344a768 100644 (file)
@@ -26,7 +26,7 @@ Comm::Connection::~Connection()
     cbdataReferenceDone(_peer);
 }
 
-Comm::ConnectionPointer &
+Comm::ConnectionPointer
 Comm::Connection::copyDetails() const
 {
     ConnectionPointer c = new Comm::Connection;
index 23209c3662ea8b39f26f5d3b927188f462e47c6b..da1b651cff0f4064226bc874afbb307078126cc6 100644 (file)
@@ -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();
index 7a7234cd95d8cce1d955966c3ced519c1df0b0c3..18ea8ac02f1e64234f9ea393a874b151f87b5b42 100644 (file)
@@ -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)) {