proxygen
|
#include <DirectResponseHandler.h>
Public Member Functions | |
DirectResponseHandler (int code, std::string message, std::string body) | |
void | onRequest (std::unique_ptr< HTTPMessage >) noexceptoverride |
void | onBody (std::unique_ptr< folly::IOBuf >) noexceptoverride |
void | onUpgrade (proxygen::UpgradeProtocol) noexceptoverride |
void | onEOM () noexceptoverride |
void | requestComplete () noexceptoverride |
void | onError (ProxygenError) noexceptoverride |
![]() | |
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 | |
const int | code_ |
std::string | message_ |
std::unique_ptr< folly::IOBuf > | body_ |
Additional Inherited Members | |
![]() | |
ResponseHandler * | downstream_ {nullptr} |
Handler that sends a fixed response back.
Definition at line 20 of file DirectResponseHandler.h.
|
inline |
Definition at line 22 of file DirectResponseHandler.h.
|
inlineoverridevirtualnoexcept |
Invoked when we get part of body for the request.
Implements proxygen::RequestHandler.
Definition at line 32 of file DirectResponseHandler.h.
|
inlineoverridevirtualnoexcept |
Invoked when we finish receiving the body.
Implements proxygen::RequestHandler.
Definition at line 36 of file DirectResponseHandler.h.
References proxygen::ResponseBuilder::body(), body_, code_, proxygen::RequestHandler::downstream_, message_, folly::gen::move, 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 47 of file DirectResponseHandler.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 30 of file DirectResponseHandler.h.
|
inlineoverridevirtualnoexcept |
Invoked when the session has been upgraded to a different protocol
Implements proxygen::RequestHandler.
Definition at line 34 of file DirectResponseHandler.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 43 of file DirectResponseHandler.h.
|
private |
Definition at line 52 of file DirectResponseHandler.h.
Referenced by onEOM().
|
private |
Definition at line 50 of file DirectResponseHandler.h.
Referenced by onEOM().
|
private |
Definition at line 51 of file DirectResponseHandler.h.
Referenced by onEOM().