diff --git a/src/app_helper.cc b/src/app_helper.cc index e61c5793..90c9fa8c 100644 --- a/src/app_helper.cc +++ b/src/app_helper.cc @@ -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(altsvc->field_value_len), altsvc->field_value); break; } + case NGHTTP2_ORIGIN: { + auto origin = static_cast(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; } diff --git a/src/nghttp.cc b/src/nghttp.cc index 4f05d6c0..58ee8804 100644 --- a/src/nghttp.cc +++ b/src/nghttp.cc @@ -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); }