]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 3247: Domain from URL Stripped when going through peers
authorAmos Jeffries <squid3@treenet.co.nz>
Fri, 24 Jun 2011 04:05:33 +0000 (16:05 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 24 Jun 2011 04:05:33 +0000 (16:05 +1200)
Also, extra debug details on peer select routing choices

src/peer_select.cc

index 9c3e28f6f69a1e4f62333408dc187aa9a739d9b8..9e0145d8523b4d9285166999e5a509d3cdc8ed5a 100644 (file)
@@ -209,18 +209,21 @@ peerSelectDnsPaths(ps_state *psstate)
     psstate->callback = NULL;
 
     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==1?"YES":(psstate->always_direct==0?"NO":"maybe")));
-        debugs(44, DBG_IMPORTANT, "   never_direct = " << (psstate->never_direct==1?"YES":(psstate->never_direct==0?"NO":"maybe")));
-        debugs(44, DBG_IMPORTANT, "       timedout = " << psstate->ping.timedout  );
+        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 sources for '" << psstate->entry->url() << "'" );
-        debugs(44, 2, "  always_direct = " << (psstate->always_direct?"YES":(psstate->always_direct==0?"NO":"maybe")));
+        debugs(44, 2, "Found sources for '" << psstate->entry->url() << "'");
+        debugs(44, 2, "  always_direct = " << psstate->always_direct);
+        debugs(44, 2, "   never_direct = " << psstate->never_direct);
         for (size_t i = 0; i < psstate->paths->size(); i++) {
-            debugs(44, 2, "   cache_peer = " << (*psstate->paths)[i]);
+            if ((*psstate->paths)[i]->peerType == HIER_DIRECT)
+                debugs(44, 2, "         DIRECT = " << (*psstate->paths)[i]);
+            else
+                debugs(44, 2, "     cache_peer = " << (*psstate->paths)[i]);
         }
-        debugs(44, 2, "   never_direct = " << (psstate->never_direct?"YES":(psstate->never_direct==0?"NO":"maybe")));
-        debugs(44, 2, "       timedout = " << psstate->ping.timedout  );
+        debugs(44, 2, "       timedout = " << psstate->ping.timedout);
     }
 
     psstate->ping.stop = current_time;
@@ -272,6 +275,7 @@ peerSelectDnsResults(const ipcache_addrs *ia, const DnsLookupDetails &details, v
             else
                 p->remote.SetPort(psstate->request->port);
             p->peerType = fs->code;
+            p->setPeer(fs->_peer);
 
             // check for a configured outgoing address for this destination...
             getOutgoingAddress(psstate->request, p);