/*
- * Copyright (C) 1996-2015 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"
-#include "URL.h"
#include <cmath>
}
CachePeer *
-carpSelectParent(HttpRequest * request)
+carpSelectParent(PeerSelector *ps)
{
+ assert(ps);
+ HttpRequest *request = ps->request;
+
int k;
CachePeer *p = NULL;
CachePeer *tp;
// this code follows URI syntax pattern.
// corner cases should use the full effective request URI
if (tp->options.carp_key.scheme) {
- key.append(request->url.getScheme().c_str());
+ key.append(request->url.getScheme().image());
if (key.length()) //if the scheme is not empty
key.append("://");
}
debugs(39, 3, "carpSelectParent: key=" << key << " name=" << 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;
}