proxygen
ProxyService::ProxyHandler::ServerTransactionHandler Class Reference
Inheritance diagram for ProxyService::ProxyHandler::ServerTransactionHandler:
proxygen::HTTPTransactionHandler

Public Member Functions

 ServerTransactionHandler (ProxyHandler &parent)
 
- Public Member Functions inherited from proxygen::HTTPTransactionHandler
virtual void onChunkHeader (size_t) noexcept
 
virtual void onChunkComplete () noexcept
 
virtual void onPushedTransaction (HTTPTransaction *) noexcept
 
virtual void onExTransaction (HTTPTransaction *) noexcept
 
virtual void onGoaway (ErrorCode) noexcept
 
virtual ~HTTPTransactionHandler ()
 

Private Member Functions

void setTransaction (proxygen::HTTPTransaction *) noexceptoverride
 
void detachTransaction () noexceptoverride
 
void onHeadersComplete (std::unique_ptr< proxygen::HTTPMessage > msg) noexceptoverride
 
void onBody (std::unique_ptr< folly::IOBuf > chain) noexceptoverride
 
void onTrailers (std::unique_ptr< proxygen::HTTPHeaders >) noexceptoverride
 
void onEOM () noexceptoverride
 
void onUpgrade (proxygen::UpgradeProtocol) noexceptoverride
 
void onError (const proxygen::HTTPException &error) noexceptoverride
 
void onEgressPaused () noexceptoverride
 
void onEgressResumed () noexceptoverride
 

Private Attributes

ProxyHandlerparent_
 

Detailed Description

Definition at line 67 of file ProxyHandler.h.

Constructor & Destructor Documentation

ProxyService::ProxyHandler::ServerTransactionHandler::ServerTransactionHandler ( ProxyHandler parent)
inlineexplicit

Definition at line 69 of file ProxyHandler.h.

70  : parent_(parent) {
71  }
folly::Function< void()> parent
Definition: AtFork.cpp:34

Member Function Documentation

void ProxyService::ProxyHandler::ServerTransactionHandler::detachTransaction ( )
inlineoverrideprivatevirtualnoexcept

Called once after a transaction successfully completes. It will be called even if a read or write error happened earlier. This is a terminal callback, which means that the HTTPTransaction object that gives this call will be invalid after this function completes.

Implements proxygen::HTTPTransactionHandler.

Definition at line 78 of file ProxyHandler.h.

References ProxyService::ProxyHandler::detachServerTransaction().

void ProxyService::ProxyHandler::ServerTransactionHandler::onBody ( std::unique_ptr< folly::IOBuf chain)
inlineoverrideprivatevirtualnoexcept

Can be called multiple times per transaction. If you had previously called pauseIngress(), this callback will be delayed until you call resumeIngress().

Implements proxygen::HTTPTransactionHandler.

Definition at line 86 of file ProxyHandler.h.

References folly::gen::move, and ProxyService::ProxyHandler::onServerBody().

86  {
88  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
void onServerBody(std::unique_ptr< folly::IOBuf > chain) noexcept
void ProxyService::ProxyHandler::ServerTransactionHandler::onEgressPaused ( )
inlineoverrideprivatevirtualnoexcept

If the remote side's receive buffer fills up, this callback will be invoked so you can attempt to stop sending to the remote side.

Implements proxygen::HTTPTransactionHandler.

Definition at line 105 of file ProxyHandler.h.

References ProxyService::ProxyHandler::onServerEgressPaused().

void ProxyService::ProxyHandler::ServerTransactionHandler::onEgressResumed ( )
inlineoverrideprivatevirtualnoexcept

This callback lets you know that the remote side has resumed reading and you can now continue to send data.

Implements proxygen::HTTPTransactionHandler.

Definition at line 108 of file ProxyHandler.h.

References ProxyService::ProxyHandler::onServerEgressResumed().

void ProxyService::ProxyHandler::ServerTransactionHandler::onEOM ( )
inlineoverrideprivatevirtualnoexcept

Can be called once per transaction. If you had previously called pauseIngress(), this callback will be delayed until you call resumeIngress(). After this callback is received, there will be no more normal ingress callbacks received (onEgress*() and onError() may still be invoked). The Handler should consider ingress complete after receiving this message. This Transaction is still valid, and work may still occur on it until detachTransaction is called.

Implements proxygen::HTTPTransactionHandler.

Definition at line 94 of file ProxyHandler.h.

References ProxyService::ProxyHandler::onServerEOM().

void ProxyService::ProxyHandler::ServerTransactionHandler::onError ( const proxygen::HTTPException error)
inlineoverrideprivatevirtualnoexcept

Can be called at any time before detachTransaction(). This callback implies that an error has occurred. To determine if ingress or egress is affected, check the direciont on the HTTPException. If the direction is INGRESS, it MAY still be possible to send egress.

Implements proxygen::HTTPTransactionHandler.

Definition at line 101 of file ProxyHandler.h.

References ProxyService::ProxyHandler::onServerError().

101  {
102  parent_.onServerError(error);
103  }
void onServerError(const proxygen::HTTPException &error) noexcept
void ProxyService::ProxyHandler::ServerTransactionHandler::onHeadersComplete ( std::unique_ptr< proxygen::HTTPMessage msg)
inlineoverrideprivatevirtualnoexcept

Called at most once per transaction. This is usually the first ingress callback. It is possible to get a read error before this however. If you had previously called pauseIngress(), this callback will be delayed until you call resumeIngress().

Implements proxygen::HTTPTransactionHandler.

Definition at line 81 of file ProxyHandler.h.

References folly::gen::move, and ProxyService::ProxyHandler::onServerHeadersComplete().

82  {
84  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
void onServerHeadersComplete(std::unique_ptr< proxygen::HTTPMessage > msg) noexcept
void ProxyService::ProxyHandler::ServerTransactionHandler::onTrailers ( std::unique_ptr< proxygen::HTTPHeaders trailers)
inlineoverrideprivatevirtualnoexcept

Can be called any number of times per transaction. If you had previously called pauseIngress(), this callback will be delayed until you call resumeIngress(). Trailers can be received once right before the EOM of a chunked HTTP/1.1 reponse or multiple times per transaction from SPDY and HTTP/2.0 HEADERS frames.

Implements proxygen::HTTPTransactionHandler.

Definition at line 90 of file ProxyHandler.h.

91  {
92  // ignore for now
93  }
void ProxyService::ProxyHandler::ServerTransactionHandler::onUpgrade ( proxygen::UpgradeProtocol  protocol)
inlineoverrideprivatevirtualnoexcept

Can be called once per transaction. If you had previously called pauseIngress(), this callback will be delayed until you call resumeIngress(). After this callback is invoked, further data will be forwarded using the onBody() callback. Once the data transfer is completed (EOF recevied in case of CONNECT), onEOM() callback will be invoked.

Implements proxygen::HTTPTransactionHandler.

Definition at line 97 of file ProxyHandler.h.

97  {
98  // ignore for now
99  }
void ProxyService::ProxyHandler::ServerTransactionHandler::setTransaction ( proxygen::HTTPTransaction txn)
inlineoverrideprivatevirtualnoexcept

Called once per transaction. This notifies the handler of which transaction it should talk to and will receive callbacks from.

Implements proxygen::HTTPTransactionHandler.

Definition at line 75 of file ProxyHandler.h.

75  {
76  // no op
77  }

Member Data Documentation

ProxyHandler& ProxyService::ProxyHandler::ServerTransactionHandler::parent_
private

Definition at line 73 of file ProxyHandler.h.


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