proxygen
proxygen::HTTPSessionAcceptor Class Referenceabstract

#include <HTTPSessionAcceptor.h>

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

Public Member Functions

 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 ()
 
virtual HTTPTransaction::HandlernewHandler (HTTPTransaction &txn, HTTPMessage *msg) noexcept=0
 
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
 

Protected Member Functions

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)
 
virtual void onSessionCreationError (ProxygenError)
 
- 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

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_
 

Private Member Functions

 HTTPSessionAcceptor (const HTTPSessionAcceptor &)=delete
 
HTTPSessionAcceptoroperator= (const HTTPSessionAcceptor &)=delete
 
- Private Member Functions inherited from proxygen::HTTPSessionBase::InfoCallback
virtual ~InfoCallback ()
 
virtual void onCreate (const HTTPSessionBase &)
 
virtual void onFullHandshakeCompletion (const HTTPSessionBase &)
 
virtual void onIngressError (const HTTPSessionBase &, ProxygenError)
 
virtual void onIngressEOF ()
 
virtual void onRead (const HTTPSessionBase &, size_t)
 
virtual void onWrite (const HTTPSessionBase &, size_t)
 
virtual void onRequestBegin (const HTTPSessionBase &)
 
virtual void onRequestEnd (const HTTPSessionBase &, uint32_t)
 
virtual void onActivateConnection (const HTTPSessionBase &)
 
virtual void onDeactivateConnection (const HTTPSessionBase &)
 
virtual void onDestroy (const HTTPSessionBase &)
 
virtual void onIngressMessage (const HTTPSessionBase &, const HTTPMessage &)
 
virtual void onIngressLimitExceeded (const HTTPSessionBase &)
 
virtual void onIngressPaused (const HTTPSessionBase &)
 
virtual void onTransactionDetached (const HTTPSessionBase &)
 
virtual void onPingReplySent (int64_t)
 
virtual void onPingReplyReceived ()
 
virtual void onSettingsOutgoingStreamsFull (const HTTPSessionBase &)
 
virtual void onSettingsOutgoingStreamsNotFull (const HTTPSessionBase &)
 
virtual void onFlowControlWindowClosed (const HTTPSessionBase &)
 
virtual void onEgressBuffered (const HTTPSessionBase &)
 
virtual void onEgressBufferCleared (const HTTPSessionBase &)
 
virtual void onSettings (const HTTPSessionBase &, const SettingsList &)
 
virtual void onSettingsAck (const HTTPSessionBase &)
 

Private Attributes

std::unique_ptr< HTTPErrorPagedefaultErrorPage_
 
std::unique_ptr< HTTPErrorPagediagnosticErrorPage_
 
std::shared_ptr< HTTPCodecFactorycodecFactory_ {}
 
SimpleController simpleController_
 
HTTPSession::InfoCallbacksessionInfoCb_ {nullptr}
 

Static Private Attributes

static const folly::SocketAddress unknownSocketAddress_
 

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 ()
 

Detailed Description

Specialization of Acceptor that serves as an abstract base for acceptors that support HTTP and related protocols.

Definition at line 28 of file HTTPSessionAcceptor.h.

Constructor & Destructor Documentation

proxygen::HTTPSessionAcceptor::HTTPSessionAcceptor ( const AcceptorConfiguration accConfig)
explicit

Definition at line 26 of file HTTPSessionAcceptor.cpp.

Referenced by onSessionCreationError().

27  : HTTPSessionAcceptor(accConfig, nullptr) {}
HTTPSessionAcceptor(const AcceptorConfiguration &accConfig)
proxygen::HTTPSessionAcceptor::HTTPSessionAcceptor ( const AcceptorConfiguration accConfig,
std::shared_ptr< HTTPCodecFactory codecFactory 
)
explicit

Definition at line 29 of file HTTPSessionAcceptor.cpp.

References proxygen::HTTPAcceptor::accConfig_, and codecFactory_.

31  :
32  HTTPAcceptor(accConfig),
33  codecFactory_(codecFactory),
34  simpleController_(this) {
35  if (!codecFactory_) {
37  std::make_shared<HTTPDefaultSessionCodecFactory>(accConfig_);
38  }
39 }
AcceptorConfiguration accConfig_
Definition: HTTPAcceptor.h:52
HTTPAcceptor(const AcceptorConfiguration &accConfig)
Definition: HTTPAcceptor.h:23
std::shared_ptr< HTTPCodecFactory > codecFactory_
proxygen::HTTPSessionAcceptor::~HTTPSessionAcceptor ( )
override

Definition at line 41 of file HTTPSessionAcceptor.cpp.

41  {
42 }
proxygen::HTTPSessionAcceptor::HTTPSessionAcceptor ( const HTTPSessionAcceptor )
privatedelete

Member Function Documentation

size_t proxygen::HTTPSessionAcceptor::dropIdleConnections ( size_t  num)
protectedvirtual

Definition at line 127 of file HTTPSessionAcceptor.cpp.

References wangle::Acceptor::downstreamConnectionManager_.

Referenced by makeNewAsyncSocket().

127  {
128  // release in batch for more efficiency
129  VLOG(6) << "attempt to release resource";
130  return downstreamConnectionManager_->dropIdleConnections(num);
131 }
wangle::ConnectionManager::UniquePtr downstreamConnectionManager_
Definition: Acceptor.h:438
std::shared_ptr<HTTPCodecFactory> proxygen::HTTPSessionAcceptor::getCodecFactory ( )
inline

return the codec factory for this session

Definition at line 86 of file HTTPSessionAcceptor.h.

References codecFactory_, newHandler(), and folly::pushmi::__adl::noexcept().

86  {
87  return codecFactory_;
88  }
std::shared_ptr< HTTPCodecFactory > codecFactory_
virtual HTTPSessionController* proxygen::HTTPSessionAcceptor::getController ( )
inlineprotectedvirtual

This function is invoked when a new session is created to get the controller to associate with the new session. Child classes may override this function to provide their own more sophisticated controller here.

Definition at line 119 of file HTTPSessionAcceptor.h.

References simpleController_.

Referenced by onNewConnection().

119  {
120  return &simpleController_;
121  }
const HTTPErrorPage* proxygen::HTTPSessionAcceptor::getDefaultErrorPage ( ) const
inline

Access the default error page generator.

Definition at line 47 of file HTTPSessionAcceptor.h.

References defaultErrorPage_.

47  {
48  return defaultErrorPage_.get();
49  }
std::unique_ptr< HTTPErrorPage > defaultErrorPage_
const HTTPErrorPage* proxygen::HTTPSessionAcceptor::getDiagnosticErrorPage ( ) const
inline

Access the diagnostic error page generator.

Definition at line 61 of file HTTPSessionAcceptor.h.

References addr, diagnosticErrorPage_, and getErrorPage().

61  {
62  return diagnosticErrorPage_.get();
63  }
std::unique_ptr< HTTPErrorPage > diagnosticErrorPage_
const HTTPErrorPage * proxygen::HTTPSessionAcceptor::getErrorPage ( const folly::SocketAddress addr) const
virtual

Access the right error page generator for a connection.

Parameters
localAddrAddress of the local end of the connection.
Returns
The diagnostic error page generator if one has been set AND the connection is to an internal VIP, or else the default error page generator if one has been set, or else nullptr.

Definition at line 44 of file HTTPSessionAcceptor.cpp.

References defaultErrorPage_, diagnosticErrorPage_, proxygen::HTTPAcceptor::isInternal(), and folly::SocketAddress::isPrivateAddress().

Referenced by getDiagnosticErrorPage(), proxygen::SimpleController::getParseErrorHandler(), and proxygen::SimpleController::getTransactionTimeoutHandler().

45  {
46  const HTTPErrorPage* errorPage = nullptr;
47  if (isInternal()) {
48  if (addr.isPrivateAddress()) {
49  errorPage = diagnosticErrorPage_.get();
50  }
51  }
52  if (errorPage == nullptr) {
53  errorPage = defaultErrorPage_.get();
54  }
55  return errorPage;
56 }
std::unique_ptr< HTTPErrorPage > diagnosticErrorPage_
bool isPrivateAddress() const
bool isInternal() const
Definition: HTTPAcceptor.h:30
std::unique_ptr< HTTPErrorPage > defaultErrorPage_
virtual bool proxygen::HTTPSessionAcceptor::getHttp2PrioritiesEnabled ( )
inlinevirtual
HTTPSession::InfoCallback* proxygen::HTTPSessionAcceptor::getSessionInfoCallback ( )
inlineprotected

Definition at line 125 of file HTTPSessionAcceptor.h.

References onNewConnection(), sessionInfoCb_, and string.

125  {
126  return sessionInfoCb_ ? sessionInfoCb_ : this;
127  }
HTTPSession::InfoCallback * sessionInfoCb_
folly::AsyncSocket::UniquePtr proxygen::HTTPSessionAcceptor::makeNewAsyncSocket ( folly::EventBase base,
int  fd 
)
inlineoverrideprotectedvirtual

Reimplemented from wangle::Acceptor.

Definition at line 137 of file HTTPSessionAcceptor.h.

References dropIdleConnections().

138  {
140  new folly::AsyncSocket(base, fd));
141  }
std::unique_ptr< AsyncSocket, Destructor > UniquePtr
Definition: AsyncSocket.h:83
virtual HTTPTransaction::Handler* proxygen::HTTPSessionAcceptor::newHandler ( HTTPTransaction txn,
HTTPMessage msg 
)
pure virtualnoexcept

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.

Implemented in proxygen::HTTPServerAcceptor, and HTTPTargetSessionAcceptor.

Referenced by getCodecFactory(), and proxygen::SimpleController::getRequestHandler().

void proxygen::HTTPSessionAcceptor::onNewConnection ( folly::AsyncTransportWrapper::UniquePtr  ,
const folly::SocketAddress ,
const std::string ,
wangle::SecureTransportType  ,
const wangle::TransportInfo  
)
overrideprotectedvirtual

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.

Parameters
sockthe socket connected to the client
addressthe address of the client
nextProtocolNamethe 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
secureTransportTypethe name of the secure transport type that was requested by the client.

Reimplemented from wangle::Acceptor.

Definition at line 58 of file HTTPSessionAcceptor.cpp.

References proxygen::HTTPAcceptor::accConfig_, wangle::ServerSocketConfig::bindAddress, codec, codecFactory_, folly::SocketAddress::describe(), proxygen::DOWNSTREAM, downstreamSessionStats_, proxygen::AcceptorConfiguration::egressSettings, getController(), getHttp2PrioritiesEnabled(), proxygen::HTTPAcceptor::getTransactionTimeoutSet(), proxygen::AcceptorConfiguration::initialReceiveWindow, folly::SocketAddress::isFamilyInet(), proxygen::kErrorUnsupportedScheme, proxygen::AcceptorConfiguration::maxConcurrentIncomingStreams, folly::gen::move, onSessionCreationError(), proxygen::AcceptorConfiguration::receiveSessionWindowSize, proxygen::AcceptorConfiguration::receiveStreamWindowSize, sessionInfoCb_, proxygen::HTTPSession::setEgressSettings(), proxygen::HTTPSession::setFlowControl(), proxygen::HTTPSession::setHTTP2PrioritiesEnabled(), proxygen::HTTPSession::setMaxConcurrentIncomingStreams(), proxygen::HTTPSession::setSessionStats(), proxygen::HTTPSessionBase::setWriteBufferLimit(), proxygen::HTTPDownstreamSession::startNow(), unknownSocketAddress_, and proxygen::AcceptorConfiguration::writeBufferLimit.

Referenced by getSessionInfoCallback(), and proxygen::HTTPServerAcceptor::onNewConnection().

63  {
64 
65  unique_ptr<HTTPCodec> codec
66  = codecFactory_->getCodec(
67  nextProtocol,
69  // we assume if security protocol isn't empty, then it's TLS
70  !sock->getSecurityProtocol().empty());
71 
72  if (!codec) {
73  VLOG(2) << "codecFactory_ failed to provide codec";
75  return;
76  }
77 
78  auto controller = getController();
79  SocketAddress localAddress;
80  try {
81  sock->getLocalAddress(&localAddress);
82  } catch (...) {
83  VLOG(3) << "couldn't get local address for socket";
84  localAddress = unknownSocketAddress_;
85  }
86 
87  // overwrite address if the socket has no IP, e.g. Unix domain socket
88  if (!localAddress.isFamilyInet()) {
90  localAddress = accConfig_.bindAddress;
91  } else {
92  localAddress = unknownSocketAddress_;
93  }
94  VLOG(4) << "set localAddress=" << localAddress.describe();
95  }
96 
97  auto sessionInfoCb = sessionInfoCb_ ? sessionInfoCb_ : this;
98  VLOG(4) << "Created new " << nextProtocol
99  << " session for peer " << *peerAddress;
100  HTTPDownstreamSession* session =
101  new HTTPDownstreamSession(getTransactionTimeoutSet(), std::move(sock),
102  localAddress, *peerAddress,
103  controller, std::move(codec), tinfo,
104  sessionInfoCb);
106  session->setMaxConcurrentIncomingStreams(
108  }
109  session->setEgressSettings(accConfig_.egressSettings);
110 
111  // set HTTP2 priorities flag on session object
112  auto HTTP2PrioritiesEnabled = getHttp2PrioritiesEnabled();
113  session->setHTTP2PrioritiesEnabled(HTTP2PrioritiesEnabled);
114 
115  // set flow control parameters
116  session->setFlowControl(accConfig_.initialReceiveWindow,
119  if (accConfig_.writeBufferLimit > 0) {
120  session->setWriteBufferLimit(accConfig_.writeBufferLimit);
121  }
122  session->setSessionStats(downstreamSessionStats_);
123  Acceptor::addConnection(session);
124  session->startNow();
125 }
AcceptorConfiguration accConfig_
Definition: HTTPAcceptor.h:52
virtual void onSessionCreationError(ProxygenError)
virtual const WheelTimerInstance & getTransactionTimeoutSet()
Definition: HTTPAcceptor.h:37
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
CodecFactory codec
std::string describe() const
bool isFamilyInet() const
folly::SocketAddress bindAddress
HTTPSessionStats * downstreamSessionStats_
virtual HTTPSessionController * getController()
HTTPSession::InfoCallback * sessionInfoCb_
static const folly::SocketAddress unknownSocketAddress_
std::shared_ptr< HTTPCodecFactory > codecFactory_
virtual void proxygen::HTTPSessionAcceptor::onSessionCreationError ( ProxygenError  )
inlineprotectedvirtual

Reimplemented in HTTPTargetSessionAcceptor.

Definition at line 145 of file HTTPSessionAcceptor.h.

References HTTPSessionAcceptor(), and operator=().

Referenced by onNewConnection().

145 {}
HTTPSessionAcceptor& proxygen::HTTPSessionAcceptor::operator= ( const HTTPSessionAcceptor )
privatedelete

Referenced by onSessionCreationError().

void proxygen::HTTPSessionAcceptor::setCodecFactory ( std::shared_ptr< HTTPCodecFactory codecFactory)
inline

Set the codec factory for this session

Definition at line 79 of file HTTPSessionAcceptor.h.

References codecFactory_.

79  {
80  codecFactory_ = codecFactory;
81  }
std::shared_ptr< HTTPCodecFactory > codecFactory_
void proxygen::HTTPSessionAcceptor::setDefaultErrorPage ( std::unique_ptr< HTTPErrorPage generator)
inline

Set the default error page generator.

Definition at line 40 of file HTTPSessionAcceptor.h.

References defaultErrorPage_, and folly::gen::move.

40  {
41  defaultErrorPage_ = std::move(generator);
42  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
std::unique_ptr< HTTPErrorPage > defaultErrorPage_
void proxygen::HTTPSessionAcceptor::setDiagnosticErrorPage ( std::unique_ptr< HTTPErrorPage generator)
inline

Set an alternate error page generator to use for internal clients.

Definition at line 54 of file HTTPSessionAcceptor.h.

References diagnosticErrorPage_, and folly::gen::move.

54  {
55  diagnosticErrorPage_ = std::move(generator);
56  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
std::unique_ptr< HTTPErrorPage > diagnosticErrorPage_
void proxygen::HTTPSessionAcceptor::setSessionInfoCallback ( HTTPSession::InfoCallback cb)
inline

Set an HTTPSession::InfoCallback to use for each session instead of the acceptor object.

Definition at line 104 of file HTTPSessionAcceptor.h.

References sessionInfoCb_.

104  {
105  sessionInfoCb_ = cb;
106  }
HTTPSession::InfoCallback * sessionInfoCb_

Member Data Documentation

std::shared_ptr<HTTPCodecFactory> proxygen::HTTPSessionAcceptor::codecFactory_ {}
private
std::unique_ptr<HTTPErrorPage> proxygen::HTTPSessionAcceptor::defaultErrorPage_
private

General-case error page generator

Definition at line 152 of file HTTPSessionAcceptor.h.

Referenced by getDefaultErrorPage(), getErrorPage(), and setDefaultErrorPage().

std::unique_ptr<HTTPErrorPage> proxygen::HTTPSessionAcceptor::diagnosticErrorPage_
private

Generator of more detailed error pages for internal clients

Definition at line 155 of file HTTPSessionAcceptor.h.

Referenced by getDiagnosticErrorPage(), getErrorPage(), and setDiagnosticErrorPage().

HTTPSessionStats* proxygen::HTTPSessionAcceptor::downstreamSessionStats_ {nullptr}
protected

Definition at line 123 of file HTTPSessionAcceptor.h.

Referenced by onNewConnection().

HTTPSession::InfoCallback* proxygen::HTTPSessionAcceptor::sessionInfoCb_ {nullptr}
private
SimpleController proxygen::HTTPSessionAcceptor::simpleController_
private

Definition at line 159 of file HTTPSessionAcceptor.h.

Referenced by getController().

const SocketAddress proxygen::HTTPSessionAcceptor::unknownSocketAddress_
staticprivate

0.0.0.0:0, a valid address to use if getsockname() or getpeername() fails

Definition at line 166 of file HTTPSessionAcceptor.h.

Referenced by onNewConnection().


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