proxygen
|
#include <SimpleController.h>
Public Member Functions | |
SimpleController (HTTPSessionAcceptor *acceptor) | |
HTTPTransactionHandler * | getRequestHandler (HTTPTransaction &txn, HTTPMessage *msg) override |
HTTPTransactionHandler * | getParseErrorHandler (HTTPTransaction *txn, const HTTPException &error, const folly::SocketAddress &localAddress) override |
HTTPTransactionHandler * | getTransactionTimeoutHandler (HTTPTransaction *txn, const folly::SocketAddress &localAddress) override |
void | attachSession (HTTPSessionBase *) override |
void | detachSession (const HTTPSessionBase *) override |
std::chrono::milliseconds | getGracefulShutdownTimeout () const override |
Public Member Functions inherited from proxygen::HTTPSessionController | |
virtual | ~HTTPSessionController () |
virtual void | onSessionCodecChange (HTTPSessionBase *) |
virtual std::chrono::milliseconds | getSessionFlowControlTimeout () const |
virtual const HeaderIndexingStrategy * | getHeaderIndexingStrategy () const |
Protected Member Functions | |
HTTPTransactionHandler * | createErrorHandler (uint32_t statusCode, const std::string &statusMessage, const HTTPErrorPage *errorPage) |
Protected Attributes | |
HTTPSessionAcceptor *const | acceptor_ {nullptr} |
This simple controller provides some basic default behaviors. When errors occur, it will install an appropriate handler. Otherwise, it will install the acceptor's default handler.
Definition at line 25 of file SimpleController.h.
|
explicit |
Definition at line 18 of file SimpleController.cpp.
|
overridevirtual |
Inform the controller it is associated with this particular session.
Implements proxygen::HTTPSessionController.
Definition at line 49 of file SimpleController.cpp.
|
protected |
Definition at line 53 of file SimpleController.cpp.
Referenced by getParseErrorHandler(), and getTransactionTimeoutHandler().
|
overridevirtual |
Informed at the end when the given HTTPSession is going away.
Implements proxygen::HTTPSessionController.
Definition at line 51 of file SimpleController.cpp.
|
overridevirtual |
Optionally allow the session to query custom graceful shutdown timeout.
Reimplemented from proxygen::HTTPSessionController.
Definition at line 63 of file SimpleController.cpp.
References acceptor_, and wangle::Acceptor::getGracefulShutdownTimeout().
|
overridevirtual |
Will be invoked when HTTPSession is unable to parse a new request on the connection because of bad input.
error contains specific information about what went wrong
Implements proxygen::HTTPSessionController.
Definition at line 27 of file SimpleController.cpp.
References acceptor_, createErrorHandler(), proxygen::HTTPException::getCodecStatusCode(), proxygen::HTTPSessionAcceptor::getErrorPage(), proxygen::HTTPException::getHttpStatusCode(), proxygen::HTTPException::hasCodecStatusCode(), and proxygen::HTTPException::hasHttpStatusCode().
|
overridevirtual |
Will be invoked whenever HTTPSession successfully parses a request
Implements proxygen::HTTPSessionController.
Definition at line 22 of file SimpleController.cpp.
References acceptor_, and proxygen::HTTPSessionAcceptor::newHandler().
|
overridevirtual |
Will be invoked when HTTPSession times out parsing a new request.
Implements proxygen::HTTPSessionController.
Definition at line 42 of file SimpleController.cpp.
References acceptor_, createErrorHandler(), and proxygen::HTTPSessionAcceptor::getErrorPage().
|
protected |
Definition at line 64 of file SimpleController.h.
Referenced by getGracefulShutdownTimeout(), getParseErrorHandler(), getRequestHandler(), and getTransactionTimeoutHandler().