proxygen
|
#include <PushRequestHandler.h>
Public Member Functions | |
PushRequestHandler (PushStats *stats) | |
void | onRequest (std::unique_ptr< proxygen::HTTPMessage > headers) noexceptoverride |
void | onBody (std::unique_ptr< folly::IOBuf > body) noexceptoverride |
void | onEOM () noexceptoverride |
void | onUpgrade (proxygen::UpgradeProtocol proto) noexceptoverride |
void | requestComplete () noexceptoverride |
void | onError (proxygen::ProxygenError err) 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 | |
PushStats *const | stats_ {nullptr} |
std::unique_ptr< folly::IOBuf > | body_ |
proxygen::ResponseHandler * | downstreamPush_ {nullptr} |
Additional Inherited Members | |
Protected Attributes inherited from proxygen::RequestHandler | |
ResponseHandler * | downstream_ {nullptr} |
Definition at line 23 of file PushRequestHandler.h.
|
explicit |
Definition at line 40 of file PushRequestHandler.cpp.
References PushService::gPushBody, PushService::kPushFileName(), and folly::readFile().
|
overridevirtualnoexcept |
Invoked when we get part of body for the request.
Implements proxygen::RequestHandler.
Definition at line 85 of file PushRequestHandler.cpp.
References body_, and folly::gen::move.
|
overridevirtualnoexcept |
Invoked when we finish receiving the body.
Implements proxygen::RequestHandler.
Definition at line 93 of file PushRequestHandler.cpp.
References proxygen::ResponseBuilder::body(), body_, proxygen::RequestHandler::downstream_, PushService::PushStats::getRequestCount(), proxygen::ResponseBuilder::header(), folly::gen::move, proxygen::ResponseBuilder::sendWithEOM(), stats_, and proxygen::ResponseBuilder::status().
|
overridevirtualnoexcept |
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 110 of file PushRequestHandler.cpp.
|
overridevirtualnoexcept |
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 47 of file PushRequestHandler.cpp.
References proxygen::ResponseBuilder::body(), PushService::createLargeBody(), proxygen::RequestHandler::downstream_, downstreamPush_, PushService::generateUrl(), proxygen::HTTP_HEADER_HOST, proxygen::ResponseHandler::newPushedResponse(), proxygen::ResponseBuilder::promise(), PushService::PushStats::recordRequest(), folly::netops::send(), proxygen::ResponseBuilder::sendWithEOM(), stats_, and proxygen::ResponseBuilder::status().
|
overridevirtualnoexcept |
Invoked when the session has been upgraded to a different protocol
Implements proxygen::RequestHandler.
Definition at line 102 of file PushRequestHandler.cpp.
|
overridevirtualnoexcept |
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 106 of file PushRequestHandler.cpp.
|
private |
Definition at line 43 of file PushRequestHandler.h.
|
private |
Definition at line 45 of file PushRequestHandler.h.
Referenced by onRequest().
Definition at line 41 of file PushRequestHandler.h.
Referenced by onEOM(), and onRequest().