proxygen
proxygen::HTTPMessageFilter Class Referenceabstract

#include <HTTPMessageFilters.h>

Inheritance diagram for proxygen::HTTPMessageFilter:
proxygen::HTTPTransactionHandler folly::DestructorCheck proxygen::MockHTTPMessageFilter

Public Member Functions

void setNextTransactionHandler (HTTPTransaction::Handler *next)
 
HTTPTransaction::HandlergetNextTransactionHandler ()
 
virtual std::unique_ptr< HTTPMessageFilterclone () noexcept=0
 
void onHeadersComplete (std::unique_ptr< HTTPMessage > msg) noexceptoverride
 
void onBody (std::unique_ptr< folly::IOBuf > chain) noexceptoverride
 
void onChunkHeader (size_t length) noexceptoverride
 
void onChunkComplete () noexceptoverride
 
void onTrailers (std::unique_ptr< HTTPHeaders > trailers) noexceptoverride
 
void onEOM () noexceptoverride
 
void onUpgrade (UpgradeProtocol protocol) noexceptoverride
 
void onError (const HTTPException &error) noexceptoverride
 
void setTransaction (HTTPTransaction *txn) noexceptfinal
 
void detachTransaction () noexceptfinal
 
void onEgressPaused () noexceptfinal
 
void onEgressResumed () noexceptfinal
 
void onPushedTransaction (HTTPTransaction *txn) noexceptfinal
 
void onExTransaction (HTTPTransaction *txn) noexceptfinal
 
virtual const std::stringgetFilterName () noexcept
 
- Public Member Functions inherited from proxygen::HTTPTransactionHandler
virtual void onGoaway (ErrorCode) noexcept
 
virtual ~HTTPTransactionHandler ()
 
- Public Member Functions inherited from folly::DestructorCheck
virtual ~DestructorCheck ()
 

Protected Member Functions

void nextOnHeadersComplete (std::unique_ptr< HTTPMessage > msg)
 
void nextOnBody (std::unique_ptr< folly::IOBuf > chain)
 
void nextOnChunkHeader (size_t length)
 
void nextOnChunkComplete ()
 
void nextOnTrailers (std::unique_ptr< HTTPHeaders > trailers)
 
void nextOnEOM ()
 
void nextOnError (const HTTPException &ex)
 

Protected Attributes

HTTPTransaction::HandlernextTransactionHandler_ {nullptr}
 

Detailed Description

Definition at line 20 of file HTTPMessageFilters.h.

Member Function Documentation

virtual std::unique_ptr<HTTPMessageFilter> proxygen::HTTPMessageFilter::clone ( )
pure virtualnoexcept
void proxygen::HTTPMessageFilter::detachTransaction ( )
inlinefinalvirtualnoexcept

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 63 of file HTTPMessageFilters.h.

References proxygen::HTTPTransactionHandler::detachTransaction(), and nextTransactionHandler_.

63  {
65  }
virtual void detachTransaction() noexcept=0
HTTPTransaction::Handler * nextTransactionHandler_
virtual const std::string& proxygen::HTTPMessageFilter::getFilterName ( )
inlinevirtualnoexcept

Reimplemented in proxygen::MockHTTPMessageFilter.

Definition at line 79 of file HTTPMessageFilters.h.

References proxygen::kMessageFilterDefaultName_.

79  {
81  }
static const std::string kMessageFilterDefaultName_
HTTPTransaction::Handler* proxygen::HTTPMessageFilter::getNextTransactionHandler ( )
inline

Definition at line 26 of file HTTPMessageFilters.h.

References clone(), nextTransactionHandler_, and folly::pushmi::__adl::noexcept().

26  {
28  }
HTTPTransaction::Handler * nextTransactionHandler_
void proxygen::HTTPMessageFilter::nextOnBody ( std::unique_ptr< folly::IOBuf chain)
inlineprotected

Definition at line 86 of file HTTPMessageFilters.h.

References folly::gen::move, nextTransactionHandler_, and proxygen::HTTPTransactionHandler::onBody().

86  {
88  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
virtual void onBody(std::unique_ptr< folly::IOBuf > chain) noexcept=0
HTTPTransaction::Handler * nextTransactionHandler_
void proxygen::HTTPMessageFilter::nextOnChunkComplete ( )
inlineprotected

Definition at line 92 of file HTTPMessageFilters.h.

References nextTransactionHandler_, and proxygen::HTTPTransactionHandler::onChunkComplete().

92  {
94  }
virtual void onChunkComplete() noexcept
HTTPTransaction::Handler * nextTransactionHandler_
void proxygen::HTTPMessageFilter::nextOnChunkHeader ( size_t  length)
inlineprotected

Definition at line 89 of file HTTPMessageFilters.h.

References nextTransactionHandler_, and proxygen::HTTPTransactionHandler::onChunkHeader().

89  {
91  }
virtual void onChunkHeader(size_t) noexcept
HTTPTransaction::Handler * nextTransactionHandler_
void proxygen::HTTPMessageFilter::nextOnEOM ( )
inlineprotected

Definition at line 98 of file HTTPMessageFilters.h.

References nextTransactionHandler_, and proxygen::HTTPTransactionHandler::onEOM().

Referenced by proxygen::MockHTTPMessageFilter::nextOnEOMPublic().

98  {
100  }
virtual void onEOM() noexcept=0
HTTPTransaction::Handler * nextTransactionHandler_
void proxygen::HTTPMessageFilter::nextOnError ( const HTTPException ex)
inlineprotected

Definition at line 101 of file HTTPMessageFilters.h.

References nextTransactionHandler_, and proxygen::HTTPTransactionHandler::onError().

101  {
103  }
virtual void onError(const HTTPException &error) noexcept=0
HTTPTransaction::Handler * nextTransactionHandler_
void proxygen::HTTPMessageFilter::nextOnHeadersComplete ( std::unique_ptr< HTTPMessage msg)
inlineprotected

Definition at line 83 of file HTTPMessageFilters.h.

References folly::gen::move, nextTransactionHandler_, and proxygen::HTTPTransactionHandler::onHeadersComplete().

Referenced by proxygen::MockHTTPMessageFilter::nextOnHeadersCompletePublic().

83  {
85  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
virtual void onHeadersComplete(std::unique_ptr< HTTPMessage > msg) noexcept=0
HTTPTransaction::Handler * nextTransactionHandler_
void proxygen::HTTPMessageFilter::nextOnTrailers ( std::unique_ptr< HTTPHeaders trailers)
inlineprotected

Definition at line 95 of file HTTPMessageFilters.h.

References folly::gen::move, nextTransactionHandler_, and proxygen::HTTPTransactionHandler::onTrailers().

95  {
97  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
virtual void onTrailers(std::unique_ptr< HTTPHeaders > trailers) noexcept=0
HTTPTransaction::Handler * nextTransactionHandler_
void proxygen::HTTPMessageFilter::onBody ( std::unique_ptr< folly::IOBuf chain)
inlineoverridevirtualnoexcept

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.

Reimplemented in proxygen::MockHTTPMessageFilter.

Definition at line 37 of file HTTPMessageFilters.h.

References folly::gen::move, nextTransactionHandler_, and proxygen::HTTPTransactionHandler::onBody().

37  {
39  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
virtual void onBody(std::unique_ptr< folly::IOBuf > chain) noexcept=0
HTTPTransaction::Handler * nextTransactionHandler_
void proxygen::HTTPMessageFilter::onChunkComplete ( )
inlineoverridevirtualnoexcept

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 from proxygen::HTTPTransactionHandler.

Definition at line 43 of file HTTPMessageFilters.h.

References nextTransactionHandler_, and proxygen::HTTPTransactionHandler::onChunkComplete().

Referenced by proxygen::MockHTTPMessageFilter::onBody().

43  {
45  }
virtual void onChunkComplete() noexcept
HTTPTransaction::Handler * nextTransactionHandler_
void proxygen::HTTPMessageFilter::onChunkHeader ( size_t  )
inlineoverridevirtualnoexcept

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 from proxygen::HTTPTransactionHandler.

Definition at line 40 of file HTTPMessageFilters.h.

References nextTransactionHandler_, and proxygen::HTTPTransactionHandler::onChunkHeader().

Referenced by proxygen::MockHTTPMessageFilter::onBody().

40  {
42  }
virtual void onChunkHeader(size_t) noexcept
HTTPTransaction::Handler * nextTransactionHandler_
void proxygen::HTTPMessageFilter::onEgressPaused ( )
inlinefinalvirtualnoexcept

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 66 of file HTTPMessageFilters.h.

References nextTransactionHandler_, and proxygen::HTTPTransactionHandler::onEgressPaused().

66  {
68  }
virtual void onEgressPaused() noexcept=0
HTTPTransaction::Handler * nextTransactionHandler_
void proxygen::HTTPMessageFilter::onEgressResumed ( )
inlinefinalvirtualnoexcept

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 69 of file HTTPMessageFilters.h.

References nextTransactionHandler_, and proxygen::HTTPTransactionHandler::onEgressResumed().

69  {
71  }
virtual void onEgressResumed() noexcept=0
HTTPTransaction::Handler * nextTransactionHandler_
void proxygen::HTTPMessageFilter::onEOM ( )
inlineoverridevirtualnoexcept

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 49 of file HTTPMessageFilters.h.

References nextTransactionHandler_, and proxygen::HTTPTransactionHandler::onEOM().

Referenced by proxygen::MockHTTPMessageFilter::onTrailers().

49  {
51  }
virtual void onEOM() noexcept=0
HTTPTransaction::Handler * nextTransactionHandler_
void proxygen::HTTPMessageFilter::onError ( const HTTPException error)
inlineoverridevirtualnoexcept

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 55 of file HTTPMessageFilters.h.

References folly::pushmi::operators::error(), nextTransactionHandler_, and proxygen::HTTPTransactionHandler::onError().

Referenced by proxygen::MockHTTPMessageFilter::onTrailers().

55  {
57  }
virtual void onError(const HTTPException &error) noexcept=0
requires And< SemiMovable< VN >... > &&SemiMovable< E > auto error(E e)
Definition: error.h:48
HTTPTransaction::Handler * nextTransactionHandler_
void proxygen::HTTPMessageFilter::onExTransaction ( HTTPTransaction )
inlinefinalvirtualnoexcept

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

Reimplemented from proxygen::HTTPTransactionHandler.

Definition at line 75 of file HTTPMessageFilters.h.

References nextTransactionHandler_, and proxygen::HTTPTransactionHandler::onExTransaction().

75  {
77  }
virtual void onExTransaction(HTTPTransaction *) noexcept
HTTPTransaction::Handler * nextTransactionHandler_
void proxygen::HTTPMessageFilter::onHeadersComplete ( std::unique_ptr< HTTPMessage msg)
inlineoverridevirtualnoexcept

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.

Reimplemented in proxygen::MockHTTPMessageFilter.

Definition at line 34 of file HTTPMessageFilters.h.

References folly::gen::move, nextTransactionHandler_, and proxygen::HTTPTransactionHandler::onHeadersComplete().

34  {
36  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
virtual void onHeadersComplete(std::unique_ptr< HTTPMessage > msg) noexcept=0
HTTPTransaction::Handler * nextTransactionHandler_
void proxygen::HTTPMessageFilter::onPushedTransaction ( HTTPTransaction )
inlinefinalvirtualnoexcept

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 from proxygen::HTTPTransactionHandler.

Definition at line 72 of file HTTPMessageFilters.h.

References nextTransactionHandler_, and proxygen::HTTPTransactionHandler::onPushedTransaction().

72  {
74  }
virtual void onPushedTransaction(HTTPTransaction *) noexcept
HTTPTransaction::Handler * nextTransactionHandler_
void proxygen::HTTPMessageFilter::onTrailers ( std::unique_ptr< HTTPHeaders trailers)
inlineoverridevirtualnoexcept

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.

Reimplemented in proxygen::MockHTTPMessageFilter.

Definition at line 46 of file HTTPMessageFilters.h.

References folly::gen::move, nextTransactionHandler_, and proxygen::HTTPTransactionHandler::onTrailers().

46  {
48  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
virtual void onTrailers(std::unique_ptr< HTTPHeaders > trailers) noexcept=0
HTTPTransaction::Handler * nextTransactionHandler_
void proxygen::HTTPMessageFilter::onUpgrade ( UpgradeProtocol  protocol)
inlineoverridevirtualnoexcept

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 52 of file HTTPMessageFilters.h.

References nextTransactionHandler_, and proxygen::HTTPTransactionHandler::onUpgrade().

Referenced by proxygen::MockHTTPMessageFilter::onTrailers().

52  {
54  }
virtual void onUpgrade(UpgradeProtocol protocol) noexcept=0
HTTPTransaction::Handler * nextTransactionHandler_
void proxygen::HTTPMessageFilter::setNextTransactionHandler ( HTTPTransaction::Handler next)
inline

Definition at line 23 of file HTTPMessageFilters.h.

References nextTransactionHandler_.

23  {
24  nextTransactionHandler_ = CHECK_NOTNULL(next);
25  }
def next(obj)
Definition: ast.py:58
HTTPTransaction::Handler * nextTransactionHandler_
void proxygen::HTTPMessageFilter::setTransaction ( HTTPTransaction txn)
inlinefinalvirtualnoexcept

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 60 of file HTTPMessageFilters.h.

References nextTransactionHandler_, and proxygen::HTTPTransactionHandler::setTransaction().

60  {
62  }
virtual void setTransaction(HTTPTransaction *txn) noexcept=0
HTTPTransaction::Handler * nextTransactionHandler_

Member Data Documentation


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