PeerPoolMgr.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 1996-2023 The Squid Software Foundation and contributors
3 *
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
7 */
8
9#ifndef SQUID_PEERPOOLMGR_H
10#define SQUID_PEERPOOLMGR_H
11
12#include "base/AsyncJob.h"
13#include "base/JobWait.h"
14#include "comm/forward.h"
15#include "security/forward.h"
16
17class HttpRequest;
18class CachePeer;
20
22class PeerPoolMgr: public AsyncJob
23{
25
26public:
28
29 // syncs mgr state whenever connection-related peer or pool state changes
30 static void Checkpoint(const Pointer &mgr, const char *reason);
31
32 explicit PeerPoolMgr(CachePeer *aPeer);
33 ~PeerPoolMgr() override;
34
35protected:
36 /* AsyncJob API */
37 void start() override;
38 void swanSong() override;
39 bool doneAll() const override;
40
42 bool validPeer() const;
43
46 void checkpoint(const char *reason);
48 void openNewConnection();
50 void closeOldConnections(const int howMany);
51
54
57
60
61private:
64
67
70
71 unsigned int addrUsed;
72};
73
74#endif /* SQUID_PEERPOOLMGR_H */
75
int conn
the current server connection FD
Definition: Transport.cc:26
Maintains an fixed-size "standby" PconnPool for a single CachePeer.
Definition: PeerPoolMgr.h:23
JobWait< Security::BlindPeerConnector > encryptionWait
waits for the established transport connection to be secured/encrypted
Definition: PeerPoolMgr.h:69
void checkpoint(const char *reason)
Definition: PeerPoolMgr.cc:211
CBDATA_CHILD(PeerPoolMgr)
void handleSecuredPeer(Security::EncryptorAnswer &answer)
Security::PeerConnector callback.
Definition: PeerPoolMgr.cc:124
unsigned int addrUsed
counter for cycling through peer addresses
Definition: PeerPoolMgr.h:71
void openNewConnection()
starts the process of opening a new standby connection (if possible)
Definition: PeerPoolMgr.cc:157
void swanSong() override
Definition: PeerPoolMgr.cc:60
void start() override
called by AsyncStart; do not call directly
Definition: PeerPoolMgr.cc:46
~PeerPoolMgr() override
Definition: PeerPoolMgr.cc:40
RefCount< HttpRequest > request
fake HTTP request for conn opening code
Definition: PeerPoolMgr.h:63
void handleOpenedConnection(const CommConnectCbParams &params)
Comm::ConnOpener calls this when done opening a connection for us.
Definition: PeerPoolMgr.cc:78
void closeOldConnections(const int howMany)
closes 'howMany' standby connections
Definition: PeerPoolMgr.cc:204
static void Checkpoint(const Pointer &mgr, const char *reason)
Definition: PeerPoolMgr.cc:229
bool doneAll() const override
whether positive goal has been reached
Definition: PeerPoolMgr.cc:72
CbcPointer< PeerPoolMgr > Pointer
Definition: PeerPoolMgr.h:27
CachePeer * peer
the owner of the pool we manage
Definition: PeerPoolMgr.h:62
JobWait< Comm::ConnOpener > transportWait
waits for a transport connection to the peer to be established/opened
Definition: PeerPoolMgr.h:66
void pushNewConnection(const Comm::ConnectionPointer &conn)
the final step in connection opening (and, optionally, securing) sequence
Definition: PeerPoolMgr.cc:115
bool validPeer() const
whether the peer is still out there and in a valid state we can safely use
Definition: PeerPoolMgr.cc:66
PeerPoolMgr(CachePeer *aPeer)
Definition: PeerPoolMgr.cc:31

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors