Re-format debug text output

This commit is contained in:
Tatsuhiro Tsujikawa 2016-10-14 22:49:29 +09:00
parent 5e99531b4d
commit 19340da8d4
3 changed files with 22 additions and 30 deletions

View File

@ -1024,8 +1024,7 @@ static int emit_indname_block(nghttp2_bufs *bufs, size_t idx,
prefixlen = 4; prefixlen = 4;
} }
DEBUGF("deflatehd: emit indname index=%zu, valuelen=%zu, " DEBUGF("deflatehd: emit indname index=%zu, valuelen=%zu, indexing_mode=%d\n",
"indexing_mode=%d\n",
idx, nv->valuelen, indexing_mode); idx, nv->valuelen, indexing_mode);
blocklen = count_encoded_length(idx + 1, prefixlen); blocklen = count_encoded_length(idx + 1, prefixlen);
@ -1057,8 +1056,8 @@ static int emit_newname_block(nghttp2_bufs *bufs, const nghttp2_nv *nv,
int indexing_mode) { int indexing_mode) {
int rv; int rv;
DEBUGF("deflatehd: emit newname namelen=%zu, valuelen=%zu, " DEBUGF(
"indexing_mode=%d\n", "deflatehd: emit newname namelen=%zu, valuelen=%zu, indexing_mode=%d\n",
nv->namelen, nv->valuelen, indexing_mode); nv->namelen, nv->valuelen, indexing_mode);
rv = nghttp2_bufs_addb(bufs, pack_first_byte(indexing_mode)); rv = nghttp2_bufs_addb(bufs, pack_first_byte(indexing_mode));
@ -1864,8 +1863,8 @@ ssize_t nghttp2_hd_inflate_hd_nv(nghttp2_hd_inflater *inflater,
switch (inflater->state) { switch (inflater->state) {
case NGHTTP2_HD_STATE_EXPECT_TABLE_SIZE: case NGHTTP2_HD_STATE_EXPECT_TABLE_SIZE:
if ((*in & 0xe0u) != 0x20u) { if ((*in & 0xe0u) != 0x20u) {
DEBUGF("inflatehd: header table size change was " DEBUGF("inflatehd: header table size change was expected, but saw "
"expected, but saw 0x%02x as first byte", "0x%02x as first byte",
*in); *in);
rv = NGHTTP2_ERR_HEADER_COMP; rv = NGHTTP2_ERR_HEADER_COMP;
goto fail; goto fail;
@ -1876,8 +1875,8 @@ ssize_t nghttp2_hd_inflate_hd_nv(nghttp2_hd_inflater *inflater,
if ((*in & 0xe0u) == 0x20u) { if ((*in & 0xe0u) == 0x20u) {
DEBUGF("inflatehd: header table size change\n"); DEBUGF("inflatehd: header table size change\n");
if (inflater->state == NGHTTP2_HD_STATE_OPCODE) { if (inflater->state == NGHTTP2_HD_STATE_OPCODE) {
DEBUGF("inflatehd: header table size change must " DEBUGF("inflatehd: header table size change must appear at the head "
"appear at the head of header block\n"); "of header block\n");
rv = NGHTTP2_ERR_HEADER_COMP; rv = NGHTTP2_ERR_HEADER_COMP;
goto fail; goto fail;
} }

View File

@ -772,8 +772,7 @@ int nghttp2_session_reprioritize_stream(
if (pri_spec->stream_id == 0) { if (pri_spec->stream_id == 0) {
dep_stream = &session->root; dep_stream = &session->root;
} else if (nghttp2_stream_dep_find_ancestor(dep_stream, stream)) { } else if (nghttp2_stream_dep_find_ancestor(dep_stream, stream)) {
DEBUGF("stream: cycle detected, dep_stream(%p)=%d " DEBUGF("stream: cycle detected, dep_stream(%p)=%d stream(%p)=%d\n",
"stream(%p)=%d\n",
dep_stream, dep_stream->stream_id, stream, stream->stream_id); dep_stream, dep_stream->stream_id, stream, stream->stream_id);
nghttp2_stream_dep_remove_subtree(dep_stream); nghttp2_stream_dep_remove_subtree(dep_stream);
@ -1290,9 +1289,8 @@ int nghttp2_session_adjust_closed_stream(nghttp2_session *session) {
num_stream_max = session->local_settings.max_concurrent_streams; num_stream_max = session->local_settings.max_concurrent_streams;
} }
DEBUGF("stream: adjusting kept closed streams " DEBUGF("stream: adjusting kept closed streams num_closed_streams=%zu, "
"num_closed_streams=%zu, num_incoming_streams=%zu, " "num_incoming_streams=%zu, max_concurrent_streams=%zu\n",
"max_concurrent_streams=%zu\n",
session->num_closed_streams, session->num_incoming_streams, session->num_closed_streams, session->num_incoming_streams,
num_stream_max); num_stream_max);
@ -1340,8 +1338,7 @@ int nghttp2_session_adjust_idle_stream(nghttp2_session *session) {
16, nghttp2_min(session->local_settings.max_concurrent_streams, 16, nghttp2_min(session->local_settings.max_concurrent_streams,
session->pending_local_max_concurrent_stream))); session->pending_local_max_concurrent_stream)));
DEBUGF("stream: adjusting kept idle streams " DEBUGF("stream: adjusting kept idle streams num_idle_streams=%zu, max=%zu\n",
"num_idle_streams=%zu, max=%zu\n",
session->num_idle_streams, max); session->num_idle_streams, max);
while (session->num_idle_streams > max) { while (session->num_idle_streams > max) {
@ -1737,8 +1734,8 @@ static ssize_t
nghttp2_session_enforce_flow_control_limits(nghttp2_session *session, nghttp2_session_enforce_flow_control_limits(nghttp2_session *session,
nghttp2_stream *stream, nghttp2_stream *stream,
ssize_t requested_window_size) { ssize_t requested_window_size) {
DEBUGF("send: remote windowsize connection=%d, " DEBUGF("send: remote windowsize connection=%d, remote maxframsize=%u, "
"remote maxframsize=%u, stream(id %d)=%d\n", "stream(id %d)=%d\n",
session->remote_window_size, session->remote_settings.max_frame_size, session->remote_window_size, session->remote_settings.max_frame_size,
stream->stream_id, stream->remote_window_size); stream->stream_id, stream->remote_window_size);
@ -2968,8 +2965,8 @@ static ssize_t nghttp2_session_mem_send_internal(nghttp2_session *session,
frame = &item->frame; frame = &item->frame;
DEBUGF("send: next frame: payloadlen=%zu, type=%u, " DEBUGF("send: next frame: payloadlen=%zu, type=%u, flags=0x%02x, "
"flags=0x%02x, stream_id=%d\n", "stream_id=%d\n",
frame->hd.length, frame->hd.type, frame->hd.flags, frame->hd.length, frame->hd.type, frame->hd.flags,
frame->hd.stream_id); frame->hd.stream_id);
@ -5351,8 +5348,7 @@ ssize_t nghttp2_session_mem_recv(nghttp2_session *session, const uint8_t *in,
nghttp2_frame_unpack_frame_hd(&iframe->frame.hd, iframe->sbuf.pos); nghttp2_frame_unpack_frame_hd(&iframe->frame.hd, iframe->sbuf.pos);
iframe->payloadleft = iframe->frame.hd.length; iframe->payloadleft = iframe->frame.hd.length;
DEBUGF("recv: payloadlen=%zu, type=%u, flags=0x%02x, " DEBUGF("recv: payloadlen=%zu, type=%u, flags=0x%02x, stream_id=%d\n",
"stream_id=%d\n",
iframe->frame.hd.length, iframe->frame.hd.type, iframe->frame.hd.length, iframe->frame.hd.type,
iframe->frame.hd.flags, iframe->frame.hd.stream_id); iframe->frame.hd.flags, iframe->frame.hd.stream_id);
@ -6206,14 +6202,13 @@ ssize_t nghttp2_session_mem_recv(nghttp2_session *session, const uint8_t *in,
nghttp2_frame_unpack_frame_hd(&cont_hd, iframe->sbuf.pos); nghttp2_frame_unpack_frame_hd(&cont_hd, iframe->sbuf.pos);
iframe->payloadleft = cont_hd.length; iframe->payloadleft = cont_hd.length;
DEBUGF("recv: payloadlen=%zu, type=%u, flags=0x%02x, " DEBUGF("recv: payloadlen=%zu, type=%u, flags=0x%02x, stream_id=%d\n",
"stream_id=%d\n",
cont_hd.length, cont_hd.type, cont_hd.flags, cont_hd.stream_id); cont_hd.length, cont_hd.type, cont_hd.flags, cont_hd.stream_id);
if (cont_hd.type != NGHTTP2_CONTINUATION || if (cont_hd.type != NGHTTP2_CONTINUATION ||
cont_hd.stream_id != iframe->frame.hd.stream_id) { cont_hd.stream_id != iframe->frame.hd.stream_id) {
DEBUGF("recv: expected stream_id=%d, type=%d, but " DEBUGF("recv: expected stream_id=%d, type=%d, but got stream_id=%d, "
"got stream_id=%d, type=%u\n", "type=%u\n",
iframe->frame.hd.stream_id, NGHTTP2_CONTINUATION, iframe->frame.hd.stream_id, NGHTTP2_CONTINUATION,
cont_hd.stream_id, cont_hd.type); cont_hd.stream_id, cont_hd.type);
rv = nghttp2_session_terminate_session_with_reason( rv = nghttp2_session_terminate_session_with_reason(

View File

@ -810,8 +810,7 @@ int nghttp2_stream_dep_insert_subtree(nghttp2_stream *dep_stream,
nghttp2_stream *si; nghttp2_stream *si;
int rv; int rv;
DEBUGF("stream: dep_insert_subtree dep_stream(%p)=%d " DEBUGF("stream: dep_insert_subtree dep_stream(%p)=%d stream(%p)=%d\n",
"stream(%p)=%d\n",
dep_stream, dep_stream->stream_id, stream, stream->stream_id); dep_stream, dep_stream->stream_id, stream, stream->stream_id);
stream->sum_dep_weight += dep_stream->sum_dep_weight; stream->sum_dep_weight += dep_stream->sum_dep_weight;
@ -859,8 +858,7 @@ int nghttp2_stream_dep_add_subtree(nghttp2_stream *dep_stream,
nghttp2_stream *stream) { nghttp2_stream *stream) {
int rv; int rv;
DEBUGF("stream: dep_add_subtree dep_stream(%p)=%d " DEBUGF("stream: dep_add_subtree dep_stream(%p)=%d stream(%p)=%d\n",
"stream(%p)=%d\n",
dep_stream, dep_stream->stream_id, stream, stream->stream_id); dep_stream, dep_stream->stream_id, stream, stream->stream_id);
dep_stream->sum_dep_weight += stream->weight; dep_stream->sum_dep_weight += stream->weight;