proxygen
proxygen::HTTPAcceptor Class Reference

#include <HTTPAcceptor.h>

Inheritance diagram for proxygen::HTTPAcceptor:
wangle::Acceptor folly::AsyncServerSocket::AcceptCallback wangle::ConnectionManager::Callback folly::AsyncUDPServerSocket::Callback proxygen::HTTPSessionAcceptor HTTPTargetSessionAcceptor proxygen::HTTPServerAcceptor

Public Member Functions

 HTTPAcceptor (const AcceptorConfiguration &accConfig)
 
bool isInternal () const
 
virtual const WheelTimerInstancegetTransactionTimeoutSet ()
 
void init (folly::AsyncServerSocket *serverSocket, folly::EventBase *eventBase, wangle::SSLStats *=nullptr) override
 
const AcceptorConfigurationgetConfig () const
 
- Public Member Functions inherited from wangle::Acceptor
 Acceptor (const ServerSocketConfig &accConfig)
 
 ~Acceptor () override
 
virtual void setSSLCacheProvider (const std::shared_ptr< SSLCacheProvider > &cacheProvider)
 
virtual void resetSSLContextConfigs ()
 
void addSSLContextConfig (const SSLContextConfig &sslCtxConfig)
 
SSLContextManagergetSSLContextManager () const
 
virtual void setTLSTicketSecrets (const std::vector< std::string > &oldSecrets, const std::vector< std::string > &currentSecrets, const std::vector< std::string > &newSecrets)
 
uint32_t getNumConnections () const
 
virtual folly::EventBasegetEventBase () const
 
virtual wangle::ConnectionManagergetConnectionManager ()
 
void addConnection (wangle::ManagedConnection *connection)
 
State getState () const
 
std::chrono::milliseconds getConnTimeout () const
 
const std::stringgetName () const
 
std::chrono::milliseconds getSSLHandshakeTimeout () const
 
void setGracefulShutdownTimeout (std::chrono::milliseconds gracefulShutdown)
 
std::chrono::milliseconds getGracefulShutdownTimeout () const
 
virtual void forceStop ()
 
bool isSSL () const
 
const ServerSocketConfiggetConfig () 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
 

Protected Attributes

AcceptorConfiguration accConfig_
 
- Protected Attributes inherited from wangle::Acceptor
folly::EventBasebase_ {nullptr}
 
const ServerSocketConfig accConfig_
 
folly::AsyncSocket::OptionMap socketOptions_
 
std::unique_ptr< SSLContextManagersslCtxManager_
 
SecurityProtocolContextManager securityProtocolCtxManager_
 
TLSPlaintextPeekingCallback tlsPlaintextPeekingCallback_
 
DefaultToSSLPeekingCallback defaultPeekingCallback_
 
DefaultToFizzPeekingCallback defaultFizzPeeker_
 
wangle::ConnectionManager::UniquePtr downstreamConnectionManager_
 
std::shared_ptr< SSLCacheProvidercacheProvider_
 
wangle::TLSTicketKeySeeds currentSecrets_
 

Private Attributes

AsyncTimeoutSet::UniquePtr tcpEventsTimeouts_
 
std::unique_ptr< WheelTimerInstancetimer_
 

Additional Inherited Members

- Public Types inherited from wangle::Acceptor
enum  State : uint32_t { State::kInit, State::kRunning, State::kDraining, State::kDone }
 
- Static Public Member Functions inherited from wangle::Acceptor
static uint64_t getTotalNumPendingSSLConns ()
 
- Protected Member Functions inherited from wangle::Acceptor
virtual uint64_t getConnectionCountForLoadShedding (void) const
 
virtual uint64_t getActiveConnectionCountForLoadShedding () const
 
virtual uint64_t getWorkerMaxConnections () const
 
virtual bool canAccept (const folly::SocketAddress &)
 
virtual void onNewConnection (folly::AsyncTransportWrapper::UniquePtr, const folly::SocketAddress *, const std::string &, SecureTransportType, const TransportInfo &)
 
void onListenStarted () noexceptoverride
 
void onListenStopped () noexceptoverride
 
void onDataAvailable (std::shared_ptr< folly::AsyncUDPSocket >, const folly::SocketAddress &, std::unique_ptr< folly::IOBuf >, bool) noexceptoverride
 
virtual folly::AsyncSocket::UniquePtr makeNewAsyncSocket (folly::EventBase *base, int fd)
 
virtual folly::AsyncSSLSocket::UniquePtr makeNewAsyncSSLSocket (const std::shared_ptr< folly::SSLContext > &ctx, folly::EventBase *base, int fd)
 
virtual void onConnectionsDrained ()
 
void connectionAccepted (int fd, const folly::SocketAddress &clientAddr) noexceptoverride
 
void acceptError (const std::exception &ex) noexceptoverride
 
void acceptStopped () noexceptoverride
 
void onEmpty (const wangle::ConnectionManager &cm) override
 
void onConnectionAdded (const ManagedConnection *) override
 
void onConnectionRemoved (const ManagedConnection *) override
 
void setLoadShedConfig (std::shared_ptr< const LoadShedConfiguration > loadShedConfig, const IConnectionCounter *counter)
 
virtual void initDownstreamConnectionManager (folly::EventBase *eventBase)
 
virtual DefaultToFizzPeekingCallbackgetFizzPeeker ()
 
virtual std::shared_ptr< fizz::server::FizzServerContextcreateFizzContext ()
 
virtual std::shared_ptr< fizz::server::TicketCiphercreateFizzTicketCipher (folly::Optional< std::string >=folly::none)
 
void updateFizzContext (fizz::server::FizzServerContext *)
 

Detailed Description

Definition at line 21 of file HTTPAcceptor.h.

Constructor & Destructor Documentation

proxygen::HTTPAcceptor::HTTPAcceptor ( const AcceptorConfiguration accConfig)
inlineexplicit

Definition at line 23 of file HTTPAcceptor.h.

24  : Acceptor(accConfig)
25  , accConfig_(accConfig) {}
AcceptorConfiguration accConfig_
Definition: HTTPAcceptor.h:52
Acceptor(const ServerSocketConfig &accConfig)
Definition: Acceptor.cpp:54

Member Function Documentation

const AcceptorConfiguration& proxygen::HTTPAcceptor::getConfig ( ) const
inline

Definition at line 49 of file HTTPAcceptor.h.

References accConfig_.

49 { return accConfig_; }
AcceptorConfiguration accConfig_
Definition: HTTPAcceptor.h:52
virtual const WheelTimerInstance& proxygen::HTTPAcceptor::getTransactionTimeoutSet ( )
inlinevirtual

Access the general-purpose timeout manager for transactions.

Definition at line 37 of file HTTPAcceptor.h.

References timer_.

Referenced by proxygen::HTTPSessionAcceptor::onNewConnection().

37  {
38  return *timer_;
39  }
std::unique_ptr< WheelTimerInstance > timer_
Definition: HTTPAcceptor.h:55
void proxygen::HTTPAcceptor::init ( folly::AsyncServerSocket serverSocket,
folly::EventBase eventBase,
wangle::SSLStats stats = nullptr 
)
inlineoverridevirtual

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 from wangle::Acceptor.

Definition at line 41 of file HTTPAcceptor.h.

References accConfig_, bm::init(), timer_, and proxygen::AcceptorConfiguration::transactionIdleTimeout.

43  {
44  timer_ = std::make_unique<WheelTimerInstance>(
46  Acceptor::init(serverSocket, eventBase);
47  }
AcceptorConfiguration accConfig_
Definition: HTTPAcceptor.h:52
std::chrono::milliseconds transactionIdleTimeout
void init()
std::unique_ptr< WheelTimerInstance > timer_
Definition: HTTPAcceptor.h:55
bool proxygen::HTTPAcceptor::isInternal ( ) const
inline

Returns true if this server is internal to facebook

Definition at line 30 of file HTTPAcceptor.h.

References accConfig_, and proxygen::AcceptorConfiguration::internal.

Referenced by proxygen::HTTPSessionAcceptor::getErrorPage().

30  {
31  return accConfig_.internal;
32  }
AcceptorConfiguration accConfig_
Definition: HTTPAcceptor.h:52

Member Data Documentation

AsyncTimeoutSet::UniquePtr proxygen::HTTPAcceptor::tcpEventsTimeouts_
private

Definition at line 54 of file HTTPAcceptor.h.

std::unique_ptr<WheelTimerInstance> proxygen::HTTPAcceptor::timer_
private

Definition at line 55 of file HTTPAcceptor.h.

Referenced by getTransactionTimeoutSet(), and init().


The documentation for this class was generated from the following file: