]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Actually do DNS after peers selected
authorAmos Jeffries <squid3@treenet.co.nz>
Thu, 20 May 2010 11:59:14 +0000 (23:59 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Thu, 20 May 2010 11:59:14 +0000 (23:59 +1200)
src/peer_select.cc

index 7c74e2b166963cee3f7eb09c1f9afac5122fbbfd..f01777322233324c8af2a19ef4ea90ca30ebad0c 100644 (file)
@@ -221,16 +221,17 @@ peerSelectDnsPaths(ps_state *psstate)
     if (fs) {
         // 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);
         ipcache_nbgethostbyname(host, peerSelectDnsResults, psstate);
         return;
     }
 
     // done with DNS lookups. pass back to caller
-    PSC *callback;
-
-    callback = psstate->callback;
+    PSC *callback = psstate->callback;
     psstate->callback = NULL;
 
+    debugs(44, 2, "Found IP destination for: " << psstate->entry->url() << "'");
+
     void *cbdata;
     if (cbdataReferenceValidDone(psstate->callback_data, &cbdata)) {
         callback(psstate->paths, cbdata);
@@ -421,7 +422,9 @@ peerSelectFoo(ps_state * ps)
         break;
     }
 
-    peerSelectCallback(ps);
+    // resolve the possible peers
+    peerSelectDnsPaths(ps);
+// DEAD?    peerSelectCallback(ps);
 }
 
 int peerAllowedToUse(const peer * p, HttpRequest * request);