proxygen
HTTPTargetSessionAcceptor Class Reference
Inheritance diagram for HTTPTargetSessionAcceptor:
proxygen::HTTPSessionAcceptor proxygen::HTTPAcceptor proxygen::HTTPSessionBase::InfoCallback wangle::Acceptor folly::AsyncServerSocket::AcceptCallback wangle::ConnectionManager::Callback folly::AsyncUDPServerSocket::Callback

Public Member Functions

 HTTPTargetSessionAcceptor (const AcceptorConfiguration &accConfig)
 
HTTPTransaction::HandlernewHandler (HTTPTransaction &, HTTPMessage *) noexceptoverride
 
void onCreate (const HTTPSessionBase &session) override
 
void connectionReady (AsyncSocket::UniquePtr sock, const SocketAddress &clientAddr, const std::string &nextProtocolName, SecureTransportType secureTransportType, wangle::TransportInfo &tinfo)
 
void onSessionCreationError (ProxygenError) override
 
- Public Member Functions inherited from proxygen::HTTPSessionAcceptor
 HTTPSessionAcceptor (const AcceptorConfiguration &accConfig)
 
 HTTPSessionAcceptor (const AcceptorConfiguration &accConfig, std::shared_ptr< HTTPCodecFactory > codecFactory)
 
 ~HTTPSessionAcceptor () override
 
void setDefaultErrorPage (std::unique_ptr< HTTPErrorPage > generator)
 
const HTTPErrorPagegetDefaultErrorPage () const
 
void setDiagnosticErrorPage (std::unique_ptr< HTTPErrorPage > generator)
 
const HTTPErrorPagegetDiagnosticErrorPage () const
 
virtual const HTTPErrorPagegetErrorPage (const folly::SocketAddress &addr) const
 
void setCodecFactory (std::shared_ptr< HTTPCodecFactory > codecFactory)
 
std::shared_ptr< HTTPCodecFactorygetCodecFactory ()
 
void setSessionInfoCallback (HTTPSession::InfoCallback *cb)
 
virtual bool getHttp2PrioritiesEnabled ()
 
- Public Member Functions inherited from proxygen::HTTPAcceptor
 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
 

Public Attributes

uint32_t sessionsCreated_ {0}
 
uint32_t sessionCreationErrors_ {0}
 
std::string expectedProto_
 

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 proxygen::HTTPSessionAcceptor
virtual HTTPSessionControllergetController ()
 
HTTPSession::InfoCallbackgetSessionInfoCallback ()
 
void onNewConnection (folly::AsyncTransportWrapper::UniquePtr sock, const folly::SocketAddress *address, const std::string &nextProtocol, wangle::SecureTransportType secureTransportType, const wangle::TransportInfo &tinfo) override
 
folly::AsyncSocket::UniquePtr makeNewAsyncSocket (folly::EventBase *base, int fd) override
 
virtual size_t dropIdleConnections (size_t num)
 
- 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 &)
 
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::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 *)
 
- Protected Attributes inherited from proxygen::HTTPSessionAcceptor
HTTPSessionStatsdownstreamSessionStats_ {nullptr}
 
- Protected Attributes inherited from proxygen::HTTPAcceptor
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_
 

Detailed Description

Definition at line 32 of file HTTPSessionAcceptorTest.cpp.

Constructor & Destructor Documentation

HTTPTargetSessionAcceptor::HTTPTargetSessionAcceptor ( const AcceptorConfiguration accConfig)
inlineexplicit

Definition at line 34 of file HTTPSessionAcceptorTest.cpp.

35  : HTTPSessionAcceptor(accConfig) {
36  }
HTTPSessionAcceptor(const AcceptorConfiguration &accConfig)

Member Function Documentation

void HTTPTargetSessionAcceptor::connectionReady ( AsyncSocket::UniquePtr  sock,
const SocketAddress clientAddr,
const std::string nextProtocolName,
SecureTransportType  secureTransportType,
wangle::TransportInfo tinfo 
)
inline

Definition at line 49 of file HTTPSessionAcceptorTest.cpp.

References wangle::Acceptor::connectionReady(), and folly::gen::move.

53  {
54  HTTPSessionAcceptor::connectionReady(std::move(sock),
55  clientAddr,
56  nextProtocolName,
57  secureTransportType,
58  tinfo);
59  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
HTTPTransaction::Handler* HTTPTargetSessionAcceptor::newHandler ( HTTPTransaction txn,
HTTPMessage msg 
)
inlineoverridevirtualnoexcept

Create a Handler for a new transaction. The transaction and HTTP message (request) are passed so the implementation can construct different handlers based on these. The transaction will be explicitly set on the handler later via setTransaction. The request message will be passed in onHeadersComplete.

Implements proxygen::HTTPSessionAcceptor.

Definition at line 38 of file HTTPSessionAcceptorTest.cpp.

39  {
40  return new MockHTTPHandler();
41  }
void HTTPTargetSessionAcceptor::onCreate ( const HTTPSessionBase session)
inlineoverridevirtual

Reimplemented from proxygen::HTTPSessionBase::InfoCallback.

Definition at line 43 of file HTTPSessionAcceptorTest.cpp.

References EXPECT_EQ, proxygen::HTTPSessionBase::getCodecProtocol(), and proxygen::getCodecProtocolString().

43  {
47  }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
const std::string & getCodecProtocolString(CodecProtocol proto)
virtual CodecProtocol getCodecProtocol() const
void HTTPTargetSessionAcceptor::onSessionCreationError ( ProxygenError  )
inlineoverridevirtual

Reimplemented from proxygen::HTTPSessionAcceptor.

Definition at line 61 of file HTTPSessionAcceptorTest.cpp.

Member Data Documentation

std::string HTTPTargetSessionAcceptor::expectedProto_

Definition at line 67 of file HTTPSessionAcceptorTest.cpp.

uint32_t HTTPTargetSessionAcceptor::sessionCreationErrors_ {0}

Definition at line 66 of file HTTPSessionAcceptorTest.cpp.

uint32_t HTTPTargetSessionAcceptor::sessionsCreated_ {0}

Definition at line 65 of file HTTPSessionAcceptorTest.cpp.


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