proxygen
|
#include <ScopedHTTPServer.h>
Public Member Functions | |
ScopedHandler (HandlerType *ptr) | |
void | onRequest (std::unique_ptr< HTTPMessage > headers) noexceptoverride |
void | onBody (std::unique_ptr< folly::IOBuf > body) noexceptoverride |
void | onUpgrade (proxygen::UpgradeProtocol) noexceptoverride |
void | onEOM () noexceptoverride |
void | requestComplete () noexceptoverride |
void | onError (ProxygenError) noexceptoverride |
Public Member Functions inherited from proxygen::RequestHandler | |
virtual void | setResponseHandler (ResponseHandler *handler) noexcept |
virtual void | onEgressPaused () noexcept |
virtual void | onEgressResumed () noexcept |
virtual bool | canHandleExpect () noexcept |
virtual ExMessageHandler * | getExHandler () noexcept |
virtual ResponseHandler * | getDownstream () noexcept |
virtual | ~RequestHandler () |
Private Attributes | |
HandlerType *const | handlerPtr_ {nullptr} |
std::unique_ptr< HTTPMessage > | request_ |
folly::IOBufQueue | requestBody_ |
Additional Inherited Members | |
Protected Attributes inherited from proxygen::RequestHandler | |
ResponseHandler * | downstream_ {nullptr} |
Definition at line 21 of file ScopedHTTPServer.h.
|
inlineexplicit |
Definition at line 23 of file ScopedHTTPServer.h.
|
inlineoverridevirtualnoexcept |
Invoked when we get part of body for the request.
Implements proxygen::RequestHandler.
Definition at line 30 of file ScopedHTTPServer.h.
References folly::IOBufQueue::append(), folly::gen::move, and proxygen::ScopedHandler< HandlerType >::requestBody_.
|
inlineoverridevirtualnoexcept |
Invoked when we finish receiving the body.
Implements proxygen::RequestHandler.
Definition at line 36 of file ScopedHTTPServer.h.
References proxygen::ResponseBuilder::body(), proxygen::RequestHandler::downstream_, folly::IOBufQueue::move(), proxygen::ScopedHandler< HandlerType >::request_, proxygen::ScopedHandler< HandlerType >::requestBody_, proxygen::ResponseBuilder::sendWithEOM(), and proxygen::ResponseBuilder::status().
|
inlineoverridevirtualnoexcept |
Request failed. Maybe because of read/write error on socket or client not being able to send request in time.
NOTE: Can be invoked at any time (except for before onRequest).
No more callbacks will be invoked after this. You should clean up after yourself.
Implements proxygen::RequestHandler.
Definition at line 56 of file ScopedHTTPServer.h.
|
inlineoverridevirtualnoexcept |
Invoked when we have successfully fetched headers from client. This will always be the first callback invoked on your handler.
Implements proxygen::RequestHandler.
Definition at line 26 of file ScopedHTTPServer.h.
References folly::gen::move, and proxygen::ScopedHandler< HandlerType >::request_.
|
inlineoverridevirtualnoexcept |
Invoked when the session has been upgraded to a different protocol
Implements proxygen::RequestHandler.
Definition at line 34 of file ScopedHTTPServer.h.
|
inlineoverridevirtualnoexcept |
Invoked when request processing has been completed and nothing more needs to be done. This may be a good place to log some stats and clean up resources. This is distinct from onEOM() because it is invoked after the response is fully sent. Once this callback has been received, downstream_
should be considered invalid.
Implements proxygen::RequestHandler.
Definition at line 54 of file ScopedHTTPServer.h.
|
private |
Definition at line 58 of file ScopedHTTPServer.h.
|
private |
Definition at line 60 of file ScopedHTTPServer.h.
Referenced by proxygen::ScopedHandler< HandlerType >::onEOM(), and proxygen::ScopedHandler< HandlerType >::onRequest().
|
private |
Definition at line 61 of file ScopedHTTPServer.h.
Referenced by proxygen::ScopedHandler< HandlerType >::onBody(), and proxygen::ScopedHandler< HandlerType >::onEOM().