proxygen
|
#include <Acceptor.h>
Public Types | |
enum | State : uint32_t { State::kInit, State::kRunning, State::kDraining, State::kDone } |
Public Member Functions | |
Acceptor (const ServerSocketConfig &accConfig) | |
~Acceptor () override | |
virtual void | setSSLCacheProvider (const std::shared_ptr< SSLCacheProvider > &cacheProvider) |
virtual void | init (folly::AsyncServerSocket *serverSocket, folly::EventBase *eventBase, SSLStats *stats=nullptr) |
virtual void | resetSSLContextConfigs () |
void | addSSLContextConfig (const SSLContextConfig &sslCtxConfig) |
SSLContextManager * | getSSLContextManager () const |
virtual void | setTLSTicketSecrets (const std::vector< std::string > &oldSecrets, const std::vector< std::string > ¤tSecrets, const std::vector< std::string > &newSecrets) |
uint32_t | getNumConnections () const |
virtual folly::EventBase * | getEventBase () const |
virtual wangle::ConnectionManager * | getConnectionManager () |
void | addConnection (wangle::ManagedConnection *connection) |
State | getState () const |
std::chrono::milliseconds | getConnTimeout () const |
const std::string & | getName () const |
std::chrono::milliseconds | getSSLHandshakeTimeout () const |
void | setGracefulShutdownTimeout (std::chrono::milliseconds gracefulShutdown) |
std::chrono::milliseconds | getGracefulShutdownTimeout () const |
virtual void | forceStop () |
bool | isSSL () const |
const ServerSocketConfig & | getConfig () const |
virtual void | onDoneAcceptingConnection (int fd, const folly::SocketAddress &clientAddr, std::chrono::steady_clock::time_point acceptTime) noexcept |
void | processEstablishedConnection (int fd, const folly::SocketAddress &clientAddr, std::chrono::steady_clock::time_point acceptTime, TransportInfo &tinfo) noexcept |
virtual void | startHandshakeManager (folly::AsyncSSLSocket::UniquePtr sslSock, Acceptor *acceptor, const folly::SocketAddress &clientAddr, std::chrono::steady_clock::time_point acceptTime, TransportInfo &tinfo) noexcept |
void | drainAllConnections () |
virtual void | drainConnections (double pctToDrain) |
void | dropAllConnections () |
virtual void | dropConnections (double pctToDrop) |
virtual void | plaintextConnectionReady (folly::AsyncTransportWrapper::UniquePtr sock, const folly::SocketAddress &clientAddr, const std::string &nextProtocolName, SecureTransportType secureTransportType, TransportInfo &tinfo) |
void | connectionReady (folly::AsyncTransportWrapper::UniquePtr sock, const folly::SocketAddress &clientAddr, const std::string &nextProtocolName, SecureTransportType secureTransportType, TransportInfo &tinfo) |
virtual void | sslConnectionReady (folly::AsyncTransportWrapper::UniquePtr sock, const folly::SocketAddress &clientAddr, const std::string &nextProtocol, SecureTransportType secureTransportType, TransportInfo &tinfo) |
virtual void | sslConnectionError (const folly::exception_wrapper &ex) |
virtual void | updateSSLStats (const folly::AsyncTransportWrapper *, std::chrono::milliseconds, SSLErrorEnum) noexcept |
Public Member Functions inherited from folly::AsyncServerSocket::AcceptCallback | |
virtual | ~AcceptCallback ()=default |
virtual void | acceptStarted () noexcept |
Public Member Functions inherited from wangle::ConnectionManager::Callback | |
virtual | ~Callback ()=default |
Public Member Functions inherited from folly::AsyncUDPServerSocket::Callback | |
virtual void | onListenPaused () noexcept |
virtual void | onListenResumed () noexcept |
virtual | ~Callback ()=default |
Static Public Member Functions | |
static uint64_t | getTotalNumPendingSSLConns () |
Private Member Functions | |
Acceptor (Acceptor const &)=delete | |
Acceptor & | operator= (Acceptor const &)=delete |
void | checkDrained () |
Private Attributes | |
State | state_ {State::kInit} |
uint64_t | numPendingSSLConns_ {0} |
bool | forceShutdownInProgress_ {false} |
std::shared_ptr< const LoadShedConfiguration > | loadShedConfig_ {nullptr} |
const IConnectionCounter * | connectionCounter_ {nullptr} |
std::chrono::milliseconds | gracefulShutdownTimeout_ {5000} |
Static Private Attributes | |
static std::atomic< uint64_t > | totalNumPendingSSLConns_ {0} |
An abstract acceptor for TCP-based network services.
There is one acceptor object per thread for each listening socket. When a new connection arrives on the listening socket, it is accepted by one of the acceptor objects. From that point on the connection will be processed by that acceptor's thread.
The acceptor will call the abstract onNewConnection() method to create a new ManagedConnection object for each accepted socket. The acceptor also tracks all outstanding connections that it has accepted.
Definition at line 58 of file Acceptor.h.
|
strong |
|
explicit |
Definition at line 54 of file Acceptor.cpp.
|
override |
Definition at line 184 of file Acceptor.cpp.
|
privatedelete |
|
overrideprotectedvirtualnoexcept |
acceptError() is called if an error occurs while accepting.
The AcceptCallback will remain installed even after an accept error, as the errors are typically somewhat transient, such as being out of file descriptors. The server socket must be explicitly stopped if you wish to stop accepting after an error.
ex | An exception representing the error. |
Implements folly::AsyncServerSocket::AcceptCallback.
Definition at line 432 of file Acceptor.cpp.
Referenced by onConnectionsDrained().
|
overrideprotectedvirtualnoexcept |
acceptStopped() will be called when this AcceptCallback is removed from the AsyncServerSocket, or when the AsyncServerSocket is destroyed, whichever occurs first.
No more calls to connectionAccepted() or acceptError() will be made after acceptStopped() is invoked.
Reimplemented from folly::AsyncServerSocket::AcceptCallback.
Reimplemented in wangle::ServerAcceptor< Pipeline >.
Definition at line 441 of file Acceptor.cpp.
References checkDrained(), drainAllConnections(), kDone, kDraining, and state_.
Referenced by wangle::ServerAcceptor< Pipeline >::acceptStopped(), and onConnectionsDrained().
void wangle::Acceptor::addConnection | ( | wangle::ManagedConnection * | connection | ) |
Invoked when a new ManagedConnection is created.
This allows the Acceptor to track the outstanding connections, for tracking timeouts and for ensuring that all connections have been drained on shutdown.
Definition at line 501 of file Acceptor.cpp.
References downstreamConnectionManager_.
Referenced by getConnectionManager(), and wangle::ServerAcceptor< Pipeline >::read().
void wangle::Acceptor::addSSLContextConfig | ( | const SSLContextConfig & | sslCtxConfig | ) |
Dynamically add a new SSLContextConfig
Definition at line 187 of file Acceptor.cpp.
References accConfig_, wangle::ServerSocketConfig::bindAddress, cacheProvider_, wangle::ServerSocketConfig::initialTicketSeeds, wangle::ServerSocketConfig::sslCacheOptions, and sslCtxManager_.
Referenced by setSSLCacheProvider().
|
protectedvirtual |
Hook for subclasses to drop newly accepted connections prior to handshaking.
Definition at line 228 of file Acceptor.cpp.
References connectionCounter_, folly::SocketAddress::describe(), getActiveConnectionCountForLoadShedding(), getConnectionCountForLoadShedding(), wangle::IConnectionCounter::getNumConnections(), getWorkerMaxConnections(), loadShedConfig_, and uint64_t.
Referenced by connectionAccepted(), and getWorkerMaxConnections().
|
private |
Definition at line 466 of file Acceptor.cpp.
References base_, downstreamConnectionManager_, forceShutdownInProgress_, kDone, kDraining, numPendingSSLConns_, onConnectionsDrained(), and state_.
Referenced by acceptStopped(), onEmpty(), sslConnectionError(), and sslConnectionReady().
|
overrideprotectedvirtualnoexcept |
connectionAccepted() is called whenever a new client connection is received.
The AcceptCallback will remain installed after connectionAccepted() returns.
fd | The newly accepted client socket. The AcceptCallback assumes ownership of this socket, and is responsible for closing it when done. The newly accepted file descriptor will have already been put into non-blocking mode. |
clientAddr | A reference to a SocketAddress struct containing the client's address. This struct is only guaranteed to remain valid until connectionAccepted() returns. |
Implements folly::AsyncServerSocket::AcceptCallback.
Definition at line 277 of file Acceptor.cpp.
References canAccept(), folly::netops::close(), now(), onDoneAcceptingConnection(), folly::netops::setsockopt(), and socketOptions_.
Referenced by onConnectionsDrained().
void wangle::Acceptor::connectionReady | ( | folly::AsyncTransportWrapper::UniquePtr | sock, |
const folly::SocketAddress & | clientAddr, | ||
const std::string & | nextProtocolName, | ||
SecureTransportType | secureTransportType, | ||
TransportInfo & | tinfo | ||
) |
Process a connection that is to ready to receive L7 traffic. This method is called immediately upon accept for plaintext connections and upon completion of SSL handshaking or resumption for SSL connections.
Definition at line 365 of file Acceptor.cpp.
References wangle::TransportInfo::appProtocol, wangle::TransportInfo::initWithSocket(), kDraining, folly::gen::move, onNewConnection(), folly::AsyncSocket::setMaxReadsPerEvent(), and state_.
Referenced by HTTPTargetSessionAcceptor::connectionReady(), getTotalNumPendingSSLConns(), plaintextConnectionReady(), and sslConnectionReady().
|
protectedvirtual |
Definition at line 135 of file Acceptor.cpp.
References accConfig_, and wangle::FizzConfigUtil::createFizzContext().
Referenced by getFizzPeeker(), init(), and resetSSLContextConfigs().
|
protectedvirtual |
Definition at line 140 of file Acceptor.cpp.
References accConfig_, currentSecrets_, wangle::TLSTicketKeySeeds::currentSeeds, folly::gen::move, wangle::TLSTicketKeySeeds::newSeeds, wangle::TLSTicketKeySeeds::oldSeeds, wangle::ServerSocketConfig::sslCacheOptions, and wangle::SSLCacheOptions::sslCacheTimeout.
Referenced by getFizzPeeker(), and updateFizzContext().
void wangle::Acceptor::drainAllConnections | ( | ) |
Drains all open connections of their outstanding transactions. When a connection's transaction count reaches zero, the connection closes.
Definition at line 214 of file Acceptor.cpp.
References downstreamConnectionManager_, and gracefulShutdownTimeout_.
Referenced by acceptStopped(), and getTotalNumPendingSSLConns().
|
virtual |
Drain defined percentage of connections.
Reimplemented in wangle::ServerAcceptor< Pipeline >.
Definition at line 485 of file Acceptor.cpp.
References base_, downstreamConnectionManager_, getNumConnections(), gracefulShutdownTimeout_, and folly::INFO.
Referenced by wangle::ServerAcceptor< Pipeline >::drainConnections(), and getTotalNumPendingSSLConns().
void wangle::Acceptor::dropAllConnections | ( | ) |
Drop all connections.
forceStop() schedules dropAllConnections() to be called in the acceptor's thread.
Definition at line 513 of file Acceptor.cpp.
References base_, downstreamConnectionManager_, forceShutdownInProgress_, folly::INFO, folly::EventBase::isInEventBaseThread(), kDone, numPendingSSLConns_, onConnectionsDrained(), and state_.
Referenced by forceStop(), and getTotalNumPendingSSLConns().
|
virtual |
Force-drop "pct" (0.0 to 1.0) of remaining client connections, regardless of whether they are busy or idle.
Note: unlike dropAllConnections(), this function can be called from any thread.
Reimplemented in wangle::ServerAcceptor< Pipeline >.
Definition at line 530 of file Acceptor.cpp.
References base_, downstreamConnectionManager_, forceShutdownInProgress_, getNumConnections(), folly::INFO, and folly::EventBase::runInEventBaseThread().
Referenced by wangle::ServerAcceptor< Pipeline >::dropConnections(), and getTotalNumPendingSSLConns().
|
virtual |
Force the acceptor to drop all connections and stop processing.
This function may be called from any thread. The acceptor will not necessarily stop before this function returns: the stop will be scheduled to run in the acceptor's thread.
Reimplemented in wangle::ServerAcceptor< Pipeline >.
Definition at line 508 of file Acceptor.cpp.
References base_, dropAllConnections(), and folly::EventBase::runInEventBaseThread().
Referenced by wangle::ServerAcceptor< Pipeline >::forceStop(), getGracefulShutdownTimeout(), and TEST().
|
inlineprotectedvirtual |
Reimplemented in wangle::TestableAcceptor.
Definition at line 322 of file Acceptor.h.
Referenced by canAccept().
|
inline |
|
inlineprotectedvirtual |
Reimplemented in wangle::TestableAcceptor.
Definition at line 321 of file Acceptor.h.
Referenced by canAccept().
|
inlinevirtual |
Access the Acceptor's downstream (client-side) ConnectionManager
Definition at line 132 of file Acceptor.h.
References addConnection(), and downstreamConnectionManager_.
Referenced by wangle::AcceptorHandshakeManager::startHandshakeTimeout().
milliseconds wangle::Acceptor::getConnTimeout | ( | ) | const |
Get the current connection timeout.
Definition at line 497 of file Acceptor.cpp.
References accConfig_, and wangle::ServerSocketConfig::connectionIdleTimeout.
Referenced by getState().
|
inlinevirtual |
Access the Acceptor's event base.
Definition at line 127 of file Acceptor.h.
References base_.
Referenced by wangle::ServerBootstrap< DefaultPipeline >::bind(), wangle::ServerBootstrap< DefaultPipeline >::bindImpl(), proxygen::HTTPServer::updateTicketSeeds(), and proxygen::HTTPServer::updateTLSCredentials().
|
inlineprotectedvirtual |
Definition at line 414 of file Acceptor.h.
References createFizzContext(), createFizzTicketCipher(), defaultFizzPeeker_, folly::none, and updateFizzContext().
Referenced by init(), resetSSLContextConfigs(), and setTLSTicketSecrets().
|
inline |
Definition at line 182 of file Acceptor.h.
References forceStop(), and gracefulShutdownTimeout_.
Referenced by proxygen::SimpleController::getGracefulShutdownTimeout().
|
inline |
Returns the name of this VIP.
Will return an empty string if no name has been configured.
Definition at line 162 of file Acceptor.h.
References accConfig_, and wangle::ServerSocketConfig::name.
Referenced by proxygen::ServiceWorker::addServiceAcceptor(), and init().
|
inline |
Return the number of outstanding connections in this service instance.
Definition at line 119 of file Acceptor.h.
References downstreamConnectionManager_, and uint32_t.
Referenced by drainConnections(), dropConnections(), and TEST().
|
inline |
Definition at line 104 of file Acceptor.h.
References setTLSTicketSecrets(), and sslCtxManager_.
|
inline |
Returns the ssl handshake connection timeout of this VIP
Definition at line 169 of file Acceptor.h.
References accConfig_, and wangle::ServerSocketConfig::sslHandshakeTimeout.
Referenced by wangle::AcceptorHandshakeManager::startHandshakeTimeout().
|
inline |
Get this acceptor's current state.
Definition at line 148 of file Acceptor.h.
References getConnTimeout(), and state_.
Referenced by TEST().
|
inlinestatic |
Definition at line 199 of file Acceptor.h.
References connectionReady(), drainAllConnections(), drainConnections(), dropAllConnections(), dropConnections(), folly::pushmi::__adl::noexcept(), onDoneAcceptingConnection(), plaintextConnectionReady(), processEstablishedConnection(), sslConnectionError(), sslConnectionReady(), startHandshakeManager(), string, and totalNumPendingSSLConns_.
|
inlineprotectedvirtual |
Definition at line 323 of file Acceptor.h.
References canAccept(), connectionCounter_, and wangle::IConnectionCounter::getMaxConnections().
Referenced by canAccept().
|
virtual |
Initialize the Acceptor to run in the specified EventBase thread, receiving connections from the specified AsyncServerSocket.
This method will be called from the AsyncServerSocket's primary thread, not the specified EventBase thread.
Reimplemented in wangle::ServerAcceptor< Pipeline >, and proxygen::HTTPAcceptor.
Definition at line 60 of file Acceptor.cpp.
References accConfig_, folly::AsyncServerSocket::addAcceptCallback(), wangle::SecurityProtocolContextManager::addPeeker(), wangle::ServerSocketConfig::allowInsecureConnectionsOnSecureServer, wangle::ServerSocketConfig::bindAddress, cacheProvider_, createFizzContext(), wangle::TLSTicketKeySeeds::currentSeeds, defaultPeekingCallback_, wangle::FizzConfig::enableFizz, wangle::ServerSocketConfig::fizzConfig, getFizzPeeker(), getName(), folly::AsyncServerSocket::getSockets(), folly::INFO, initDownstreamConnectionManager(), wangle::ServerSocketConfig::initialTicketSeeds, wangle::ServerSocketConfig::isSSL(), folly::gen::move, wangle::TLSTicketKeySeeds::newSeeds, wangle::TLSTicketKeySeeds::oldSeeds, securityProtocolCtxManager_, setTLSTicketSecrets(), socketOptions_, wangle::ServerSocketConfig::sslCacheOptions, wangle::ServerSocketConfig::sslContextConfigs, sslCtxManager_, wangle::ServerSocketConfig::strictSSL, and tlsPlaintextPeekingCallback_.
Referenced by wangle::ServerAcceptor< Pipeline >::init(), setSSLCacheProvider(), TEST(), and TestAcceptor::TestAcceptor().
|
protectedvirtual |
Definition at line 126 of file Acceptor.cpp.
References accConfig_, base_, wangle::ServerSocketConfig::connectionIdleTimeout, downstreamConnectionManager_, kRunning, wangle::ConnectionManager::makeUnique(), and state_.
Referenced by init().
|
inline |
Definition at line 195 of file Acceptor.h.
References accConfig_, and wangle::ServerSocketConfig::isSSL().
Referenced by proxygen::HTTPServer::updateTicketSeeds(), and proxygen::HTTPServer::updateTLSCredentials().
|
inlineprotectedvirtual |
Reimplemented in proxygen::HTTPSessionAcceptor.
Definition at line 365 of file Acceptor.h.
Referenced by processEstablishedConnection().
|
inlineprotectedvirtual |
Definition at line 372 of file Acceptor.h.
Referenced by processEstablishedConnection().
|
inlineoverrideprotectedvirtual |
Invoked when a connection is added to the ConnectionManager.
Implements wangle::ConnectionManager::Callback.
Reimplemented in wangle::ServerAcceptor< Pipeline >.
Definition at line 403 of file Acceptor.h.
|
inlineoverrideprotectedvirtual |
Invoked when a connection is removed from the ConnectionManager.
Implements wangle::ConnectionManager::Callback.
Reimplemented in wangle::ServerAcceptor< Pipeline >.
Definition at line 404 of file Acceptor.h.
|
inlineprotectedvirtual |
onConnectionsDrained() will be called once all connections have been drained while the acceptor is stopping.
Subclasses can override this method to perform any subclass-specific cleanup.
Reimplemented in proxygen::HTTPServerAcceptor.
Definition at line 392 of file Acceptor.h.
References acceptError(), acceptStopped(), connectionAccepted(), and onEmpty().
Referenced by checkDrained(), and dropAllConnections().
|
inlineoverrideprotectedvirtualnoexcept |
Invoked when a new packet is received
Implements folly::AsyncUDPServerSocket::Callback.
Reimplemented in wangle::ServerAcceptor< Pipeline >.
Definition at line 359 of file Acceptor.h.
|
virtualnoexcept |
Called right when the TCP connection has been accepted, before processing the first HTTP bytes (HTTP) or the SSL handshake (HTTPS)
Definition at line 295 of file Acceptor.cpp.
References processEstablishedConnection().
Referenced by connectionAccepted(), and getTotalNumPendingSSLConns().
|
overrideprotectedvirtual |
Invoked when the number of connections managed by the ConnectionManager changes from nonzero to zero.
Implements wangle::ConnectionManager::Callback.
Definition at line 458 of file Acceptor.cpp.
References checkDrained(), kDraining, and state_.
Referenced by onConnectionsDrained().
|
inlineoverrideprotectedvirtualnoexcept |
Invoked when we start reading data from socket. It is invoked in each acceptors/listeners event base thread.
Implements folly::AsyncUDPServerSocket::Callback.
Definition at line 357 of file Acceptor.h.
|
inlineoverrideprotectedvirtualnoexcept |
Invoked when the server socket is closed. It is invoked in each acceptors/listeners event base thread.
Implements folly::AsyncUDPServerSocket::Callback.
Definition at line 358 of file Acceptor.h.
|
inlineprotectedvirtual |
Invoked when a new connection is created. This is where application starts processing a new downstream connection.
NOTE: Application should add the new connection to downstreamConnectionManager so that it can be garbage collected after certain period of idleness.
sock | the socket connected to the client |
address | the address of the client |
nextProtocolName | the name of the L6 or L7 protocol to be spoken on the connection, if known (e.g., from TLS NPN during secure connection setup), or an empty string if unknown |
secureTransportType | the name of the secure transport type that was requested by the client. |
Reimplemented in wangle::ServerAcceptor< Pipeline >, proxygen::HTTPSessionAcceptor, TestAcceptor, proxygen::HTTPServerAcceptor, and TestAcceptor.
Definition at line 350 of file Acceptor.h.
Referenced by connectionReady().
|
virtual |
Wrapper for connectionReady() that can be overridden by subclasses to deal with plaintext connections.
Definition at line 388 of file Acceptor.cpp.
References connectionReady(), and folly::gen::move.
Referenced by getTotalNumPendingSSLConns(), and processEstablishedConnection().
|
noexcept |
Begins either processing HTTP bytes (HTTP) or the SSL handshake (HTTPS)
Definition at line 304 of file Acceptor.cpp.
References accConfig_, base_, wangle::DROPPED, folly::pushmi::operators::error(), wangle::ServerSocketConfig::isSSL(), makeNewAsyncSocket(), makeNewAsyncSSLSocket(), wangle::ServerSocketConfig::maxConcurrentSSLHandshakes, folly::gen::move, wangle::ServerSocketConfig::name, wangle::NONE, numPendingSSLConns_, plaintextConnectionReady(), sslConnectionError(), sslCtxManager_, startHandshakeManager(), totalNumPendingSSLConns_, and updateSSLStats().
Referenced by getTotalNumPendingSSLConns(), and onDoneAcceptingConnection().
|
virtual |
Recreates ssl configs, re-reads certs
Definition at line 162 of file Acceptor.cpp.
References accConfig_, wangle::ServerSocketConfig::bindAddress, cacheProvider_, createFizzContext(), wangle::FizzConfig::enableFizz, wangle::ServerSocketConfig::fizzConfig, getFizzPeeker(), folly::gen::move, wangle::DefaultToFizzPeekingCallback::setContext(), wangle::ServerSocketConfig::sslCacheOptions, wangle::ServerSocketConfig::sslContextConfigs, sslCtxManager_, and updateFizzContext().
Referenced by setSSLCacheProvider(), and proxygen::HTTPServer::updateTLSCredentials().
|
inline |
Time after drainAllConnections() or acceptStopped() during which new requests on connections owned by the downstream ConnectionManager will be processed normally.
Definition at line 178 of file Acceptor.h.
References gracefulShutdownTimeout_.
|
protected |
Definition at line 221 of file Acceptor.cpp.
References connectionCounter_, counter, and loadShedConfig_.
|
inlinevirtual |
Supply an SSL cache provider
Definition at line 78 of file Acceptor.h.
References addSSLContextConfig(), cacheProvider_, init(), and resetSSLContextConfigs().
|
virtual |
Sets TLS ticket secrets to use, or updates previously set secrets.
Definition at line 195 of file Acceptor.cpp.
References accConfig_, currentSecrets_, wangle::TLSTicketKeySeeds::currentSeeds, wangle::FizzConfig::enableFizz, wangle::ServerSocketConfig::fizzConfig, getFizzPeeker(), wangle::TLSTicketKeySeeds::newSeeds, wangle::TLSTicketKeySeeds::oldSeeds, sslCtxManager_, and updateFizzContext().
Referenced by getSSLContextManager(), init(), and proxygen::HTTPServer::updateTicketSeeds().
|
virtual |
Notification callback for SSL handshake failures.
Reimplemented in wangle::ServerAcceptor< Pipeline >.
Definition at line 422 of file Acceptor.cpp.
References checkDrained(), kDraining, numPendingSSLConns_, state_, and totalNumPendingSSLConns_.
Referenced by getTotalNumPendingSSLConns(), processEstablishedConnection(), and wangle::ServerAcceptor< Pipeline >::sslConnectionError().
|
virtual |
Wrapper for connectionReady() that decrements the count of pending SSL connections. This should normally not be overridden.
Definition at line 403 of file Acceptor.cpp.
References checkDrained(), connectionReady(), kDraining, folly::gen::move, numPendingSSLConns_, state_, and totalNumPendingSSLConns_.
Referenced by getTotalNumPendingSSLConns().
|
virtualnoexcept |
Creates and starts the handshake manager.
Definition at line 353 of file Acceptor.cpp.
References wangle::SecurityProtocolContextManager::getHandshakeManager(), folly::gen::move, securityProtocolCtxManager_, and wangle::AcceptorHandshakeManager::start().
Referenced by getTotalNumPendingSSLConns(), and processEstablishedConnection().
|
protected |
Definition at line 149 of file Acceptor.cpp.
References accConfig_, cipher, createFizzTicketCipher(), folly::gen::move, fizz::server::FizzServerContext::setTicketCipher(), wangle::ServerSocketConfig::sslContextConfigs, and string.
Referenced by getFizzPeeker(), resetSSLContextConfigs(), and setTLSTicketSecrets().
|
inlinevirtualnoexcept |
Hook for subclasses to record stats about SSL connection establishment.
sock may be nullptr.
Definition at line 305 of file Acceptor.h.
Referenced by processEstablishedConnection().
|
protected |
Definition at line 407 of file Acceptor.h.
Referenced by addSSLContextConfig(), createFizzContext(), createFizzTicketCipher(), getConfig(), getConnTimeout(), getName(), getSSLHandshakeTimeout(), init(), initDownstreamConnectionManager(), isSSL(), processEstablishedConnection(), resetSSLContextConfigs(), setTLSTicketSecrets(), and updateFizzContext().
|
protected |
Our event loop.
Probably needs to be used to pass to a ManagedConnection implementation. Also visible in case a subclass wishes to do additional things w/ the event loop (e.g. in attach()).
Definition at line 319 of file Acceptor.h.
Referenced by checkDrained(), drainConnections(), dropAllConnections(), dropConnections(), forceStop(), getEventBase(), initDownstreamConnectionManager(), and processEstablishedConnection().
|
protected |
Definition at line 440 of file Acceptor.h.
Referenced by addSSLContextConfig(), init(), resetSSLContextConfigs(), and setSSLCacheProvider().
|
private |
Definition at line 458 of file Acceptor.h.
Referenced by canAccept(), getWorkerMaxConnections(), and setLoadShedConfig().
|
protected |
Definition at line 441 of file Acceptor.h.
Referenced by createFizzTicketCipher(), and setTLSTicketSecrets().
|
protected |
Definition at line 436 of file Acceptor.h.
Referenced by getFizzPeeker().
|
protected |
Definition at line 435 of file Acceptor.h.
Referenced by init().
|
protected |
Definition at line 438 of file Acceptor.h.
Referenced by addConnection(), checkDrained(), drainAllConnections(), drainConnections(), dropAllConnections(), dropConnections(), proxygen::HTTPSessionAcceptor::dropIdleConnections(), getConnectionManager(), getNumConnections(), and initDownstreamConnectionManager().
|
private |
Definition at line 456 of file Acceptor.h.
Referenced by checkDrained(), dropAllConnections(), and dropConnections().
|
private |
Definition at line 459 of file Acceptor.h.
Referenced by drainAllConnections(), drainConnections(), getGracefulShutdownTimeout(), and setGracefulShutdownTimeout().
|
private |
Definition at line 457 of file Acceptor.h.
Referenced by canAccept(), and setLoadShedConfig().
|
private |
Definition at line 452 of file Acceptor.h.
Referenced by checkDrained(), dropAllConnections(), processEstablishedConnection(), sslConnectionError(), and sslConnectionReady().
|
protected |
Stores peekers for different security protocols.
Definition at line 432 of file Acceptor.h.
Referenced by init(), and startHandshakeManager().
|
protected |
Socket options to apply to the client socket
Definition at line 425 of file Acceptor.h.
Referenced by connectionAccepted(), and init().
|
protected |
Definition at line 427 of file Acceptor.h.
Referenced by addSSLContextConfig(), getSSLContextManager(), init(), processEstablishedConnection(), resetSSLContextConfigs(), and setTLSTicketSecrets().
|
private |
Definition at line 451 of file Acceptor.h.
Referenced by acceptStopped(), checkDrained(), connectionReady(), dropAllConnections(), getState(), initDownstreamConnectionManager(), onEmpty(), sslConnectionError(), and sslConnectionReady().
|
protected |
Definition at line 434 of file Acceptor.h.
Referenced by init().
|
staticprivate |
Definition at line 454 of file Acceptor.h.
Referenced by getTotalNumPendingSSLConns(), processEstablishedConnection(), sslConnectionError(), and sslConnectionReady().