request(),
connWait(),
encryptionWait(),
- closer(),
addrUsed(0)
{
}
// Handle TLS peers.
if (peer->secure.encryptTransport) {
- typedef CommCbMemFunT<PeerPoolMgr, CommCloseCbParams> CloserDialer;
- closer = JobCallback(48, 3, CloserDialer, this,
- PeerPoolMgr::handleSecureClosure);
- comm_add_close_handler(params.conn->fd, closer);
-
AsyncCall::Pointer callback = asyncCall(48, 4, "PeerPoolMgr::handleSecuredPeer",
MyAnswerDialer(this, &PeerPoolMgr::handleSecuredPeer));
{
encryptionWait.finish();
- if (closer != NULL) {
- if (answer.conn != NULL)
- comm_remove_close_handler(answer.conn->fd, closer);
- else
- closer->cancel("securing completed");
- closer = NULL;
- }
-
if (!validPeer()) {
debugs(48, 3, "peer gone");
if (answer.conn != NULL)
pushNewConnection(answer.conn);
}
-void
-PeerPoolMgr::handleSecureClosure(const CommCloseCbParams ¶ms)
-{
- Must(closer != NULL);
- Must(encryptionWait);
- encryptionWait.cancel("conn closed by a 3rd party");
- closer = NULL;
- // allow the closing connection to fully close before we check again
- Checkpoint(this, "conn closure while securing");
-}
-
void
PeerPoolMgr::openNewConnection()
{
/// Security::PeerConnector callback
void handleSecuredPeer(Security::EncryptorAnswer &answer);
- /// called when the connection we are trying to secure is closed by a 3rd party
- void handleSecureClosure(const CommCloseCbParams ¶ms);
-
/// the final step in connection opening (and, optionally, securing) sequence
void pushNewConnection(const Comm::ConnectionPointer &conn);
/// encrypts an established transport connection
JobWait<Security::BlindPeerConnector> encryptionWait;
- AsyncCall::Pointer closer; ///< monitors conn while we are securing it
unsigned int addrUsed; ///< counter for cycling through peer addresses
};