Commit 47c14470 authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

src: Print SETTINGS string name

parent d194a31e
...@@ -74,6 +74,22 @@ const char* strstatus(nghttp2_error_code error_code) ...@@ -74,6 +74,22 @@ const char* strstatus(nghttp2_error_code error_code)
} }
} // namespace } // namespace
namespace {
const char* strsettingsid(int32_t id)
{
switch(id) {
case NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS:
return "MAX_CONCURRENT_STREAMS";
case NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE:
return "INITIAL_WINDOW_SIZE";
case NGHTTP2_SETTINGS_FLOW_CONTROL_OPTIONS:
return "FLOW_CONTROL_OPTIONS";
default:
return "UNKNOWN";
}
}
} // namespace
namespace { namespace {
const char *frame_names[] = { const char *frame_names[] = {
"DATA", "DATA",
...@@ -261,7 +277,8 @@ void print_frame(print_type ptype, nghttp2_frame *frame) ...@@ -261,7 +277,8 @@ void print_frame(print_type ptype, nghttp2_frame *frame)
printf("(niv=%lu)\n", static_cast<unsigned long>(frame->settings.niv)); printf("(niv=%lu)\n", static_cast<unsigned long>(frame->settings.niv));
for(size_t i = 0; i < frame->settings.niv; ++i) { for(size_t i = 0; i < frame->settings.niv; ++i) {
print_frame_attr_indent(); print_frame_attr_indent();
printf("[%d:%u]\n", printf("[%s(%d):%u]\n",
strsettingsid(frame->settings.iv[i].settings_id),
frame->settings.iv[i].settings_id, frame->settings.iv[i].settings_id,
frame->settings.iv[i].value); frame->settings.iv[i].value);
} }
......
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