Skip to content

Commit

Permalink
http2: fix errors in debug statements
Browse files Browse the repository at this point in the history
When compiling with --debug-http2 flag, compiler complains
about passing wrong type of argument to DEBUG_HTTP2. Fix
by using static_cast to uint32_t.

PR-URL: #16373
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
apapirovski authored and gibfahn committed Oct 31, 2017
1 parent 3a230b4 commit 3638694
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions src/node_http2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -141,42 +141,45 @@ void PackSettings(const FunctionCallbackInfo<Value>& args) {

if (flags & (1 << IDX_SETTINGS_HEADER_TABLE_SIZE)) {
DEBUG_HTTP2("Setting header table size: %d\n",
buffer[IDX_SETTINGS_HEADER_TABLE_SIZE]);
static_cast<uint32_t>(buffer[IDX_SETTINGS_HEADER_TABLE_SIZE]));
entries.push_back({NGHTTP2_SETTINGS_HEADER_TABLE_SIZE,
buffer[IDX_SETTINGS_HEADER_TABLE_SIZE]});
}

if (flags & (1 << IDX_SETTINGS_MAX_CONCURRENT_STREAMS)) {
DEBUG_HTTP2("Setting max concurrent streams: %d\n",
buffer[IDX_SETTINGS_MAX_CONCURRENT_STREAMS]);
static_cast<uint32_t>(
buffer[IDX_SETTINGS_MAX_CONCURRENT_STREAMS]));
entries.push_back({NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS,
buffer[IDX_SETTINGS_MAX_CONCURRENT_STREAMS]});
}

if (flags & (1 << IDX_SETTINGS_MAX_FRAME_SIZE)) {
DEBUG_HTTP2("Setting max frame size: %d\n",
buffer[IDX_SETTINGS_MAX_FRAME_SIZE]);
static_cast<uint32_t>(buffer[IDX_SETTINGS_MAX_FRAME_SIZE]));
entries.push_back({NGHTTP2_SETTINGS_MAX_FRAME_SIZE,
buffer[IDX_SETTINGS_MAX_FRAME_SIZE]});
}

if (flags & (1 << IDX_SETTINGS_INITIAL_WINDOW_SIZE)) {
DEBUG_HTTP2("Setting initial window size: %d\n",
buffer[IDX_SETTINGS_INITIAL_WINDOW_SIZE]);
static_cast<uint32_t>(
buffer[IDX_SETTINGS_INITIAL_WINDOW_SIZE]));
entries.push_back({NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE,
buffer[IDX_SETTINGS_INITIAL_WINDOW_SIZE]});
}

if (flags & (1 << IDX_SETTINGS_MAX_HEADER_LIST_SIZE)) {
DEBUG_HTTP2("Setting max header list size: %d\n",
buffer[IDX_SETTINGS_MAX_HEADER_LIST_SIZE]);
static_cast<uint32_t>(
buffer[IDX_SETTINGS_MAX_HEADER_LIST_SIZE]));
entries.push_back({NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE,
buffer[IDX_SETTINGS_MAX_HEADER_LIST_SIZE]});
}

if (flags & (1 << IDX_SETTINGS_ENABLE_PUSH)) {
DEBUG_HTTP2("Setting enable push: %d\n",
buffer[IDX_SETTINGS_ENABLE_PUSH]);
static_cast<uint32_t>(buffer[IDX_SETTINGS_ENABLE_PUSH]));
entries.push_back({NGHTTP2_SETTINGS_ENABLE_PUSH,
buffer[IDX_SETTINGS_ENABLE_PUSH]});
}
Expand Down Expand Up @@ -418,42 +421,45 @@ void Http2Session::SubmitSettings(const FunctionCallbackInfo<Value>& args) {

if (flags & (1 << IDX_SETTINGS_HEADER_TABLE_SIZE)) {
DEBUG_HTTP2("Setting header table size: %d\n",
buffer[IDX_SETTINGS_HEADER_TABLE_SIZE]);
static_cast<uint32_t>(buffer[IDX_SETTINGS_HEADER_TABLE_SIZE]));
entries.push_back({NGHTTP2_SETTINGS_HEADER_TABLE_SIZE,
buffer[IDX_SETTINGS_HEADER_TABLE_SIZE]});
}

if (flags & (1 << IDX_SETTINGS_MAX_CONCURRENT_STREAMS)) {
DEBUG_HTTP2("Setting max concurrent streams: %d\n",
buffer[IDX_SETTINGS_MAX_CONCURRENT_STREAMS]);
static_cast<uint32_t>(
buffer[IDX_SETTINGS_MAX_CONCURRENT_STREAMS]));
entries.push_back({NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS,
buffer[IDX_SETTINGS_MAX_CONCURRENT_STREAMS]});
}

if (flags & (1 << IDX_SETTINGS_MAX_FRAME_SIZE)) {
DEBUG_HTTP2("Setting max frame size: %d\n",
buffer[IDX_SETTINGS_MAX_FRAME_SIZE]);
static_cast<uint32_t>(buffer[IDX_SETTINGS_MAX_FRAME_SIZE]));
entries.push_back({NGHTTP2_SETTINGS_MAX_FRAME_SIZE,
buffer[IDX_SETTINGS_MAX_FRAME_SIZE]});
}

if (flags & (1 << IDX_SETTINGS_INITIAL_WINDOW_SIZE)) {
DEBUG_HTTP2("Setting initial window size: %d\n",
buffer[IDX_SETTINGS_INITIAL_WINDOW_SIZE]);
static_cast<uint32_t>(
buffer[IDX_SETTINGS_INITIAL_WINDOW_SIZE]));
entries.push_back({NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE,
buffer[IDX_SETTINGS_INITIAL_WINDOW_SIZE]});
}

if (flags & (1 << IDX_SETTINGS_MAX_HEADER_LIST_SIZE)) {
DEBUG_HTTP2("Setting max header list size: %d\n",
buffer[IDX_SETTINGS_MAX_HEADER_LIST_SIZE]);
static_cast<uint32_t>(
buffer[IDX_SETTINGS_MAX_HEADER_LIST_SIZE]));
entries.push_back({NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE,
buffer[IDX_SETTINGS_MAX_HEADER_LIST_SIZE]});
}

if (flags & (1 << IDX_SETTINGS_ENABLE_PUSH)) {
DEBUG_HTTP2("Setting enable push: %d\n",
buffer[IDX_SETTINGS_ENABLE_PUSH]);
static_cast<uint32_t>(buffer[IDX_SETTINGS_ENABLE_PUSH]));
entries.push_back({NGHTTP2_SETTINGS_ENABLE_PUSH,
buffer[IDX_SETTINGS_ENABLE_PUSH]});
}
Expand Down

0 comments on commit 3638694

Please sign in to comment.