proxygen
HTTPMessageFilters.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-present, Facebook, Inc.
3  * All rights reserved.
4  *
5  * This source code is licensed under the BSD-style license found in the
6  * LICENSE file in the root directory of this source tree. An additional grant
7  * of patent rights can be found in the PATENTS file in the same directory.
8  *
9  */
10 #pragma once
11 
13 #include <folly/Memory.h>
15 
16 namespace proxygen {
17 
18 static const std::string kMessageFilterDefaultName_ = "Unknown";
19 
21  public folly::DestructorCheck {
22  public:
24  nextTransactionHandler_ = CHECK_NOTNULL(next);
25  }
28  }
29 
30  virtual std::unique_ptr<HTTPMessageFilter> clone () noexcept = 0;
31 
32  // These HTTPTransaction::Handler callbacks may be overwritten
33  // The default behavior is to pass the call through.
34  void onHeadersComplete(std::unique_ptr<HTTPMessage> msg) noexcept override {
36  }
37  void onBody(std::unique_ptr<folly::IOBuf> chain) noexcept override {
39  }
40  void onChunkHeader(size_t length) noexcept override {
42  }
43  void onChunkComplete() noexcept override {
45  }
46  void onTrailers(std::unique_ptr<HTTPHeaders> trailers) noexcept override {
48  }
49  void onEOM() noexcept override {
51  }
52  void onUpgrade(UpgradeProtocol protocol) noexcept override {
54  }
55  void onError(const HTTPException& error) noexcept override {
57  }
58 
59  // These HTTPTransaction::Handler callbacks cannot be overrwritten
60  void setTransaction(HTTPTransaction* txn) noexcept final {
62  }
63  void detachTransaction() noexcept final {
65  }
66  void onEgressPaused() noexcept final {
68  }
69  void onEgressResumed() noexcept final {
71  }
72  void onPushedTransaction(HTTPTransaction* txn) noexcept final {
74  }
75  void onExTransaction(HTTPTransaction* txn) noexcept final {
77  }
78 
79  virtual const std::string& getFilterName() noexcept {
81  }
82  protected:
83  void nextOnHeadersComplete(std::unique_ptr<HTTPMessage> msg) {
85  }
86  void nextOnBody(std::unique_ptr<folly::IOBuf> chain) {
88  }
89  void nextOnChunkHeader(size_t length) {
91  }
94  }
95  void nextOnTrailers(std::unique_ptr<HTTPHeaders> trailers) {
97  }
98  void nextOnEOM() {
100  }
101  void nextOnError(const HTTPException& ex) {
103  }
105 };
106 
107 } // proxygen
void setTransaction(HTTPTransaction *txn) noexceptfinal
void onEgressPaused() noexceptfinal
void onExTransaction(HTTPTransaction *txn) noexceptfinal
virtual const std::string & getFilterName() noexcept
virtual void onPushedTransaction(HTTPTransaction *) noexcept
void setNextTransactionHandler(HTTPTransaction::Handler *next)
void onEOM() noexceptoverride
void onHeadersComplete(std::unique_ptr< HTTPMessage > msg) noexceptoverride
virtual void onEgressPaused() noexcept=0
void onEgressResumed() noexceptfinal
virtual void onChunkComplete() noexcept
virtual void onEgressResumed() noexcept=0
void nextOnChunkHeader(size_t length)
virtual void onError(const HTTPException &error) noexcept=0
void onError(const HTTPException &error) noexceptoverride
virtual void detachTransaction() noexcept=0
void onBody(std::unique_ptr< folly::IOBuf > chain) noexceptoverride
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
void onTrailers(std::unique_ptr< HTTPHeaders > trailers) noexceptoverride
virtual void onUpgrade(UpgradeProtocol protocol) noexcept=0
virtual void onChunkHeader(size_t) noexcept
requires E e noexcept(noexcept(s.error(std::move(e))))
requires And< SemiMovable< VN >... > &&SemiMovable< E > auto error(E e)
Definition: error.h:48
void nextOnBody(std::unique_ptr< folly::IOBuf > chain)
virtual void setTransaction(HTTPTransaction *txn) noexcept=0
void onUpgrade(UpgradeProtocol protocol) noexceptoverride
void detachTransaction() noexceptfinal
virtual void onBody(std::unique_ptr< folly::IOBuf > chain) noexcept=0
static const std::string kMessageFilterDefaultName_
void onChunkHeader(size_t length) noexceptoverride
virtual std::unique_ptr< HTTPMessageFilter > clone() noexcept=0
virtual void onExTransaction(HTTPTransaction *) noexcept
void nextOnHeadersComplete(std::unique_ptr< HTTPMessage > msg)
virtual void onHeadersComplete(std::unique_ptr< HTTPMessage > msg) noexcept=0
virtual void onEOM() noexcept=0
const char * string
Definition: Conv.cpp:212
void onChunkComplete() noexceptoverride
virtual void onTrailers(std::unique_ptr< HTTPHeaders > trailers) noexcept=0
void nextOnError(const HTTPException &ex)
void nextOnTrailers(std::unique_ptr< HTTPHeaders > trailers)
void onPushedTransaction(HTTPTransaction *txn) noexceptfinal
HTTPTransaction::Handler * getNextTransactionHandler()
def next(obj)
Definition: ast.py:58
HTTPTransaction::Handler * nextTransactionHandler_