proxygen
HTTPCodecPrinter.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 
14 namespace proxygen {
15 
23  public:
24  /*
25  * Called from SPDYCodec::parseIngress()
26  * HTTP2Codec::onIngress()
27  * when SPDY and HTTP/2 frame headers are parsed
28  */
29  void onFrameHeader(StreamID stream_id,
30  uint8_t flags,
31  uint64_t length,
32  uint8_t type,
33  uint16_t version = 0) override;
34 
35  /*
36  * Called from SPDYCodec::failSession()
37  * HTTP2Codec::checkConnectionError()
38  */
39  void onError(StreamID stream,
40  const HTTPException& error,
41  bool newStream = false) override;
42 
43  /*
44  * Called from SPDYCodec::parseIngress()
45  * HTTP2Codec::parseData()
46  */
47  void onBody(StreamID stream,
48  std::unique_ptr<folly::IOBuf> chain,
49  uint16_t padding) override;
50 
51  /*
52  * Called from SPDYCodec::parseIngress()
53  * HTTP2Codec::handleEndStream()
54  */
55  void onMessageComplete(StreamID stream, bool upgrade) override;
56 
57  /*
58  * Called from SPDYCodec::onSynCommon()
59  * HTTP2Codec::HTTP2Codec::parseHeadersImpl()
60  */
61  void onHeadersComplete(StreamID stream,
62  std::unique_ptr<HTTPMessage> msg) override;
63 
64  /*
65  * Called from SPDYCodec::onRstStream()
66  * HTTP2Codec::parseRstStream()
67  */
68  void onAbort(StreamID stream, ErrorCode code) override;
69 
70  /*
71  * Called from SPDYCodec::onWindowUpdate() with different arguments
72  * HTTP2Codec::parseWindowUpdate()
73  */
74  void onWindowUpdate(StreamID stream, uint32_t amount) override;
75 
76  /*
77  * Called from SPDYCodec::onSettings()
78  * HTTP2Codec::parseSettings()
79  */
80  void onSettings(const SettingsList& settings) override;
81 
82  /*
83  * Called from HTTP2Codec::parseSettings()
84  */
85  void onSettingsAck() override;
86 
87  /*
88  * Called from SPDYCodec::onGoaway() with different arguments
89  * HTTP2Codec::parseGoaway()
90  */
91  void onGoaway(uint64_t lastGoodStreamID, ErrorCode code,
92  std::unique_ptr<folly::IOBuf> debugData = nullptr) override;
93 
94  /*
95  * Called from SPDYCodec::onPing()
96  * HTTP2Codec::parsePing()
97  */
98  void onPingRequest(uint64_t uniqueID) override;
99 
100  /*
101  * Called from SPDYCodec::onPing()
102  * HTTP2Codec::parsePing()
103  */
104  void onPingReply(uint64_t uniqueID) override;
105 
106  protected:
107  void printPing(uint64_t uniqueID);
108 };
109 
110 }
flags
Definition: http_parser.h:127
void onMessageComplete(StreamID stream, bool upgrade) override
void onWindowUpdate(StreamID stream, uint32_t amount) override
PskType type
void onBody(StreamID stream, std::unique_ptr< folly::IOBuf > chain, uint16_t padding) override
void onPingRequest(uint64_t uniqueID) override
static http_parser_settings settings
Definition: test.c:1529
requires And< SemiMovable< VN >... > &&SemiMovable< E > auto error(E e)
Definition: error.h:48
void printPing(uint64_t uniqueID)
void onPingReply(uint64_t uniqueID) override
ProtocolVersion version
void onSettings(const SettingsList &settings) override
void onGoaway(uint64_t lastGoodStreamID, ErrorCode code, std::unique_ptr< folly::IOBuf > debugData=nullptr) override
void onHeadersComplete(StreamID stream, std::unique_ptr< HTTPMessage > msg) override
void onAbort(StreamID stream, ErrorCode code) override
std::vector< HTTPSetting > SettingsList
Definition: HTTPSettings.h:81
void onFrameHeader(StreamID stream_id, uint8_t flags, uint64_t length, uint8_t type, uint16_t version=0) override
void onError(StreamID stream, const HTTPException &error, bool newStream=false) override