Commit 325612bc authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

nghttp: Receive ORIGIN frame

parent 80342215
......@@ -106,6 +106,8 @@ std::string strframetype(uint8_t type) {
return "WINDOW_UPDATE";
case NGHTTP2_ALTSVC:
return "ALTSVC";
case NGHTTP2_ORIGIN:
return "ORIGIN";
}
std::string s = "extension(0x";
......@@ -351,6 +353,15 @@ void print_frame(print_type ptype, const nghttp2_frame *frame) {
static_cast<int>(altsvc->field_value_len), altsvc->field_value);
break;
}
case NGHTTP2_ORIGIN: {
auto origin = static_cast<nghttp2_ext_origin *>(frame->ext.payload);
for (size_t i = 0; i < origin->nov; ++i) {
auto ent = &origin->ov[i];
print_frame_attr_indent();
fprintf(outfile, "[%.*s]\n", (int)ent->origin_len, ent->origin);
}
break;
}
default:
break;
}
......
......@@ -127,6 +127,7 @@ Config::Config()
nghttp2_option_set_peer_max_concurrent_streams(http2_option,
peer_max_concurrent_streams);
nghttp2_option_set_builtin_recv_extension_type(http2_option, NGHTTP2_ALTSVC);
nghttp2_option_set_builtin_recv_extension_type(http2_option, NGHTTP2_ORIGIN);
}
Config::~Config() { nghttp2_option_del(http2_option); }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment