]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Install the userhash and sourcehash keys
authorHenrik Nordstrom <henrik@henriknordstrom.net>
Fri, 11 Jul 2008 19:52:24 +0000 (21:52 +0200)
committerHenrik Nordstrom <henrik@henriknordstrom.net>
Fri, 11 Jul 2008 19:52:24 +0000 (21:52 +0200)
src/peer_sourcehash.cc
src/peer_userhash.cc

index ad66828fb00a6f29449da6ace07ad0fedf12ca64..d291e47dc04dd0e9003fa6594ee613568da88703 100644 (file)
@@ -2,9 +2,9 @@
 /*
  * $Id: carp.cc,v 1.27 2008/01/14 12:13:49 hno Exp $
  *
- * DEBUG: section 39    Cache Array Routing Protocol
+ * DEBUG: section 39    Peer source hash based selection
  * AUTHOR: Henrik Nordstrom
- * BASED ON: carp.c by Eric Stern and draft-vinod-carp-v1-03.txt
+ * BASED ON: carp.cc
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
  * ----------------------------------------------------------
@@ -168,11 +168,12 @@ carpSelectParent(HttpRequest * request)
     double score;
     double high_score = 0;
     const char *key = NULL;
+    char ntoabuf[MAX_IPSTRLEN];
 
     if (n_carp_peers == 0)
         return NULL;
 
-    key = urlCanonical(request);
+    key = request->client_addr.NtoA(ntoabuf, sizeof(ntoabuf));
 
     /* calculate hash key */
     debugs(39, 2, "carpSelectParent: Calculating hash for " << key);
index ad66828fb00a6f29449da6ace07ad0fedf12ca64..eb679fe5ba9ed99878fa1b29bc6fa18d3c53eb61 100644 (file)
@@ -2,9 +2,9 @@
 /*
  * $Id: carp.cc,v 1.27 2008/01/14 12:13:49 hno Exp $
  *
- * DEBUG: section 39    Cache Array Routing Protocol
+ * DEBUG: section 39    Peer user hash based selection
  * AUTHOR: Henrik Nordstrom
- * BASED ON: carp.c by Eric Stern and draft-vinod-carp-v1-03.txt
+ * BASED ON: carp.cc
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
  * ----------------------------------------------------------
@@ -172,7 +172,11 @@ carpSelectParent(HttpRequest * request)
     if (n_carp_peers == 0)
         return NULL;
 
-    key = urlCanonical(request);
+    if (request->auth_user_request)
+       key = request->auth_user_request->username();
+
+    if (!key)
+       return NULL;
 
     /* calculate hash key */
     debugs(39, 2, "carpSelectParent: Calculating hash for " << key);