22 switch (
call_->getProtocol()) {
27 std::cout <<
"[CTRL FRAME] version=" << version <<
", flags=" 28 << std::hex << folly::to<unsigned int>(
flags) << std::dec
29 <<
", length=" << length
34 std::cout <<
"[DATA FRAME] stream_id=" << stream_id <<
", flags=" 35 << std::hex << folly::to<unsigned int>(
flags) << std::dec
36 <<
", length=" << length
42 std::cout <<
"[FRAME] stream_id=" << stream_id <<
", flags=" 43 << std::hex << folly::to<unsigned int>(
flags) << std::dec
44 <<
", length=" << length
52 callback_->onFrameHeader(stream_id, flags, length, type, version);
58 std::cout <<
"[Exception] " << error.
what() << std::endl;
59 callback_->onError(stream, error, newStream);
63 std::unique_ptr<folly::IOBuf> chain,
65 std::cout <<
"DataChunk: stream_id=" << stream
66 <<
", length=" << chain->
length()
67 <<
", padding=" << padding << std::endl;
72 std::cout <<
"DataComplete: stream_id=" << stream << std::endl;
73 callback_->onMessageComplete(stream, upgrade);
78 std::unique_ptr<HTTPMessage> msg) {
79 std::cout <<
"HEADERS: stream_id=" << stream
80 <<
", numHeaders=" << msg->getHeaders().size() << std::endl;
81 if (msg->isRequest()) {
82 std::cout <<
"URL=" << msg->getURL() << std::endl;
84 std::cout <<
"Status=" << msg->getStatusCode() << std::endl;
86 msg->getHeaders().forEach([&] (
89 std::cout <<
"\t" << header <<
": " << val << std::endl;
95 std::cout <<
"RST_STREAM: stream_id=" << stream <<
", error=" 101 std::unique_ptr<folly::IOBuf> debugData) {
102 std::string debugInfo = (debugData) ?
", debug info=" +
104 std::cout <<
"GOAWAY: lastGoodStream=" << lastGoodStream
110 std::cout <<
"WINDOW_UPDATE: stream_id=" << stream
111 <<
", delta_window_size=" << amount << std::endl;
112 callback_->onWindowUpdate(stream, amount);
116 std::cout <<
"SETTINGS: num=" << settings.size() << std::endl;
117 for (
const auto& setting: settings) {
118 std::cout <<
"\tid=" << folly::to<uint16_t>(setting.id)
119 <<
", value=" << setting.value << std::endl;
125 std::cout <<
"SETTINGS_ACK" << std::endl;
140 std::cout <<
"PING: unique_id=" << unique_id << std::endl;
void onMessageComplete(StreamID stream, bool upgrade) override
void onWindowUpdate(StreamID stream, uint32_t amount) override
void onSettingsAck() override
constexpr detail::Map< Move > move
const uint8_t * data() const
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
requires And< SemiMovable< VN >... > &&SemiMovable< E > auto error(E e)
void printPing(uint64_t uniqueID)
void onPingReply(uint64_t uniqueID) override
void onSettings(const SettingsList &settings) override
void onGoaway(uint64_t lastGoodStreamID, ErrorCode code, std::unique_ptr< folly::IOBuf > debugData=nullptr) override
std::size_t length() const
const char * getErrorCodeString(ErrorCode error)
void onHeadersComplete(StreamID stream, std::unique_ptr< HTTPMessage > msg) override
void onAbort(StreamID stream, ErrorCode code) override
std::vector< HTTPSetting > SettingsList
void onFrameHeader(StreamID stream_id, uint8_t flags, uint64_t length, uint8_t type, uint16_t version=0) override
const char * what(void) const noexceptoverride
void onError(StreamID stream, const HTTPException &error, bool newStream=false) override