proxygen
proxygen::HTTPTransactionHandler Class Referenceabstract

#include <HTTPTransaction.h>

Inheritance diagram for proxygen::HTTPTransactionHandler:
CurlService::CurlClient proxygen::CodecErrorResponseHandler proxygen::HTTPDirectResponseHandler proxygen::HTTPMessageFilter proxygen::HTTPPushTransactionHandler proxygen::MockHTTPHandler proxygen::RequestHandlerAdaptor ProxyService::ProxyHandler::ServerTransactionHandler

Public Member Functions

virtual void setTransaction (HTTPTransaction *txn) noexcept=0
 
virtual void detachTransaction () noexcept=0
 
virtual void onHeadersComplete (std::unique_ptr< HTTPMessage > msg) noexcept=0
 
virtual void onBody (std::unique_ptr< folly::IOBuf > chain) noexcept=0
 
virtual void onChunkHeader (size_t) noexcept
 
virtual void onChunkComplete () noexcept
 
virtual void onTrailers (std::unique_ptr< HTTPHeaders > trailers) noexcept=0
 
virtual void onEOM () noexcept=0
 
virtual void onUpgrade (UpgradeProtocol protocol) noexcept=0
 
virtual void onError (const HTTPException &error) noexcept=0
 
virtual void onEgressPaused () noexcept=0
 
virtual void onEgressResumed () noexcept=0
 
virtual void onPushedTransaction (HTTPTransaction *) noexcept
 
virtual void onExTransaction (HTTPTransaction *) noexcept
 
virtual void onGoaway (ErrorCode) noexcept
 
virtual ~HTTPTransactionHandler ()
 

Detailed Description

Definition at line 133 of file HTTPTransaction.h.

Constructor & Destructor Documentation

virtual proxygen::HTTPTransactionHandler::~HTTPTransactionHandler ( )
inlinevirtual

Definition at line 258 of file HTTPTransaction.h.

258 {}

Member Function Documentation

virtual void proxygen::HTTPTransactionHandler::detachTransaction ( )
pure virtualnoexcept

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.

Implemented in ProxyService::ProxyHandler::ServerTransactionHandler, proxygen::HTTPMessageFilter, CurlService::CurlClient, proxygen::RequestHandlerAdaptor, proxygen::PushHandler::InnerPushHandler, proxygen::HTTPDirectResponseHandler, and proxygen::CodecErrorResponseHandler.

Referenced by proxygen::HTTPMessageFilter::detachTransaction(), and proxygen::HTTPTransaction::onDelayedDestroy().

virtual void proxygen::HTTPTransactionHandler::onBody ( std::unique_ptr< folly::IOBuf chain)
pure virtualnoexcept
virtual void proxygen::HTTPTransactionHandler::onChunkComplete ( )
inlinevirtualnoexcept

Can be called multiple times per transaction. If you had previously called pauseIngress(), this callback will be delayed until you call resumeIngress(). This signifies the end of a chunk.

Reimplemented in proxygen::HTTPPushTransactionHandler, proxygen::RequestHandlerAdaptor, and proxygen::HTTPMessageFilter.

Definition at line 180 of file HTTPTransaction.h.

References folly::pushmi::operators::error().

Referenced by proxygen::HTTPMessageFilter::nextOnChunkComplete(), proxygen::HTTPMessageFilter::onChunkComplete(), and proxygen::HTTPTransaction::processIngressChunkComplete().

180 {}
virtual void proxygen::HTTPTransactionHandler::onChunkHeader ( size_t  )
inlinevirtualnoexcept

Can be called multiple times per transaction. If you had previously called pauseIngress(), this callback will be delayed until you call resumeIngress(). This signifies the beginning of a chunk of length 'length'. You will receive onBody() after this. Also, the length will be greater than zero.

Reimplemented in proxygen::HTTPPushTransactionHandler, proxygen::RequestHandlerAdaptor, and proxygen::HTTPMessageFilter.

Definition at line 173 of file HTTPTransaction.h.

Referenced by proxygen::HTTPMessageFilter::nextOnChunkHeader(), proxygen::HTTPMessageFilter::onChunkHeader(), and proxygen::HTTPTransaction::processIngressChunkHeader().

173 {}
virtual void proxygen::HTTPTransactionHandler::onEgressPaused ( )
pure virtualnoexcept
virtual void proxygen::HTTPTransactionHandler::onEgressResumed ( )
pure virtualnoexcept
virtual void proxygen::HTTPTransactionHandler::onEOM ( )
pure virtualnoexcept

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.

Implemented in proxygen::HTTPPushTransactionHandler, ProxyService::ProxyHandler::ServerTransactionHandler, CurlService::CurlClient, proxygen::RequestHandlerAdaptor, proxygen::HTTPMessageFilter, proxygen::HTTPDirectResponseHandler, and proxygen::CodecErrorResponseHandler.

Referenced by proxygen::HTTPMessageFilter::nextOnEOM(), proxygen::HTTPMessageFilter::onEOM(), and proxygen::HTTPTransaction::processIngressEOM().

virtual void proxygen::HTTPTransactionHandler::onError ( const HTTPException error)
pure virtualnoexcept

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.

Implemented in ProxyService::ProxyHandler::ServerTransactionHandler, CurlService::CurlClient, proxygen::HTTPMessageFilter, proxygen::RequestHandlerAdaptor, proxygen::PushHandler::InnerPushHandler, proxygen::HTTPDirectResponseHandler, and proxygen::CodecErrorResponseHandler.

Referenced by proxygen::HTTPMessageFilter::nextOnError(), proxygen::HTTPMessageFilter::onError(), and proxygen::HTTPTransaction::onError().

virtual void proxygen::HTTPTransactionHandler::onExTransaction ( HTTPTransaction )
inlinevirtualnoexcept

Ask the handler to construct a handler for a ExTransaction associated with its transaction.

Reimplemented in proxygen::HTTPMessageFilter, and proxygen::RequestHandlerAdaptor.

Definition at line 247 of file HTTPTransaction.h.

Referenced by proxygen::HTTPMessageFilter::onExTransaction(), and proxygen::HTTPTransaction::onExTransaction().

247 {}
virtual void proxygen::HTTPTransactionHandler::onGoaway ( ErrorCode  )
inlinevirtualnoexcept

Inform the handler that a GOAWAY has been received on the transport. This callback will only be invoked if the transport is SPDY or HTTP/2. It may be invoked multiple times, as HTTP/2 allows this.

Parameters
codeThe error code received in the GOAWAY frame

Definition at line 256 of file HTTPTransaction.h.

Referenced by proxygen::HTTPTransaction::onGoaway().

256 {}
virtual void proxygen::HTTPTransactionHandler::onHeadersComplete ( std::unique_ptr< HTTPMessage msg)
pure virtualnoexcept
virtual void proxygen::HTTPTransactionHandler::onPushedTransaction ( HTTPTransaction )
inlinevirtualnoexcept

Ask the handler to construct a handler for a pushed transaction associated with its transaction.

TODO: Reconsider default implementation here. If the handler does not implement, better set max initiated to 0 in a settings frame?

Reimplemented in proxygen::HTTPPushTransactionHandler, and proxygen::HTTPMessageFilter.

Definition at line 241 of file HTTPTransaction.h.

Referenced by proxygen::HTTPMessageFilter::onPushedTransaction(), and proxygen::HTTPTransaction::onPushedTransaction().

241 {}
virtual void proxygen::HTTPTransactionHandler::onTrailers ( std::unique_ptr< HTTPHeaders trailers)
pure virtualnoexcept

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.

Implemented in proxygen::HTTPPushTransactionHandler, proxygen::MockHTTPHandler, ProxyService::ProxyHandler::ServerTransactionHandler, CurlService::CurlClient, proxygen::RequestHandlerAdaptor, proxygen::HTTPMessageFilter, proxygen::MockHTTPMessageFilter, proxygen::HTTPDirectResponseHandler, and proxygen::CodecErrorResponseHandler.

Referenced by proxygen::HTTPMessageFilter::nextOnTrailers(), proxygen::HTTPMessageFilter::onTrailers(), and proxygen::HTTPTransaction::processIngressTrailers().

virtual void proxygen::HTTPTransactionHandler::onUpgrade ( UpgradeProtocol  protocol)
pure virtualnoexcept

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.

Implemented in proxygen::HTTPPushTransactionHandler, ProxyService::ProxyHandler::ServerTransactionHandler, CurlService::CurlClient, proxygen::HTTPMessageFilter, proxygen::RequestHandlerAdaptor, proxygen::HTTPDirectResponseHandler, and proxygen::CodecErrorResponseHandler.

Referenced by proxygen::HTTPMessageFilter::onUpgrade(), and proxygen::HTTPTransaction::processIngressUpgrade().

virtual void proxygen::HTTPTransactionHandler::setTransaction ( HTTPTransaction txn)
pure virtualnoexcept

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