/*
- * Copyright (C) 1996-2016 The Squid Software Foundation and contributors
+ * Copyright (C) 1996-2021 The Squid Software Foundation and contributors
*
* Squid software is distributed under GPLv2+ license and includes
* contributions from numerous individuals and organizations.
#include "HttpRequest.h"
#include "mgr/Registration.h"
#include "neighbors.h"
+#include "PeerSelectState.h"
#include "SquidConfig.h"
#include "Store.h"
}
CachePeer *
-peerSourceHashSelectParent(HttpRequest * request)
+peerSourceHashSelectParent(PeerSelector *ps)
{
int k;
const char *c;
if (n_sourcehash_peers == 0)
return NULL;
+ assert(ps);
+ HttpRequest *request = ps->request;
+
key = request->client_addr.toStr(ntoabuf, sizeof(ntoabuf));
/* calculate hash key */
debugs(39, 3, "peerSourceHashSelectParent: " << tp->name << " combined_hash " << combined_hash <<
" score " << std::setprecision(0) << score);
- if ((score > high_score) && peerHTTPOkay(tp, request)) {
+ if ((score > high_score) && peerHTTPOkay(tp, ps)) {
p = tp;
high_score = score;
}