#include "squid.h"
#include "CachePeer.h"
#include "HttpRequest.h"
#include "mgr/Registration.h"
#include "neighbors.h"
#include "peer_sourcehash.h"
#include "PeerSelectState.h"
#include "SquidConfig.h"
#include "Store.h"
#include <cmath>

Go to the source code of this file.
Macros | |
#define | ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n)))) |
Functions | |
static void | peerSourceHashRegisterWithCacheManager (void) |
static int | peerSortWeight (const void *a, const void *b) |
void | peerSourceHashInit (void) |
CachePeer * | peerSourceHashSelectParent (PeerSelector *ps) |
static void | peerSourceHashCachemgr (StoreEntry *sentry) |
Variables | |
static int | n_sourcehash_peers = 0 |
static CachePeer ** | sourcehash_peers = nullptr |
static OBJH | peerSourceHashCachemgr |
Macro Definition Documentation
◆ ROTATE_LEFT
#define ROTATE_LEFT | ( | x, | |
n | |||
) | (((x) << (n)) | ((x) >> (32-(n)))) |
Definition at line 23 of file peer_sourcehash.cc.
Function Documentation
◆ peerSortWeight()
|
static |
Definition at line 31 of file peer_sourcehash.cc.
References CachePeer::weight.
Referenced by peerSourceHashInit().
◆ peerSourceHashCachemgr()
|
static |
Definition at line 196 of file peer_sourcehash.cc.
References Config, CachePeer::fetches, CachePeer::name, CachePeer::next, SquidConfig::peers, CachePeer::sourcehash, CachePeer::stats, and storeAppendPrintf().
◆ peerSourceHashInit()
void peerSourceHashInit | ( | void | ) |
Definition at line 39 of file peer_sourcehash.cc.
References assert, cbdataReference, cbdataReferenceDone, Config, double, int, n_sourcehash_peers, CachePeer::name, CachePeer::next, CachePeer::options, PEER_PARENT, SquidConfig::peers, peerSortWeight(), peerSourceHashRegisterWithCacheManager(), ROTATE_LEFT, safe_free, CachePeer::sourcehash, sourcehash_peers, CachePeer::type, CachePeer::weight, and xcalloc().
Referenced by serverConnectionsOpen().
◆ peerSourceHashRegisterWithCacheManager()
|
static |
Definition at line 139 of file peer_sourcehash.cc.
References peerSourceHashCachemgr, and Mgr::RegisterAction().
Referenced by peerSourceHashInit().
◆ peerSourceHashSelectParent()
CachePeer * peerSourceHashSelectParent | ( | PeerSelector * | ps | ) |
Definition at line 146 of file peer_sourcehash.cc.
References assert, HttpRequest::client_addr, debugs, MAX_IPSTRLEN, n_sourcehash_peers, peerHTTPOkay(), PeerSelector::request, ROTATE_LEFT, CachePeer::sourcehash, sourcehash_peers, and Ip::Address::toStr().
Referenced by PeerSelector::selectSomeParent().
Variable Documentation
◆ n_sourcehash_peers
|
static |
Definition at line 25 of file peer_sourcehash.cc.
Referenced by peerSourceHashInit(), and peerSourceHashSelectParent().
◆ peerSourceHashCachemgr
|
static |
Definition at line 27 of file peer_sourcehash.cc.
Referenced by peerSourceHashRegisterWithCacheManager().
◆ sourcehash_peers
|
static |
Definition at line 26 of file peer_sourcehash.cc.
Referenced by peerSourceHashInit(), and peerSourceHashSelectParent().