http2: show stream IDs in decimal

It makes them easier to match output from the nghttpd test server.
This commit is contained in:
Daniel Stenberg 2015-05-20 14:27:08 +02:00
parent c175d184a2
commit 6a688976f0
1 changed files with 19 additions and 19 deletions

View File

@ -279,7 +279,7 @@ static int on_frame_recv(nghttp2_session *session, const nghttp2_frame *frame,
ncopy); ncopy);
stream->nread_header_recvbuf += ncopy; stream->nread_header_recvbuf += ncopy;
DEBUGF(infof(data_s, "Store %zu bytes headers from stream %x at %p\n", DEBUGF(infof(data_s, "Store %zu bytes headers from stream %u at %p\n",
ncopy, stream_id, stream->mem)); ncopy, stream_id, stream->mem));
stream->len -= ncopy; stream->len -= ncopy;
@ -300,7 +300,7 @@ static int on_frame_recv(nghttp2_session *session, const nghttp2_frame *frame,
case NGHTTP2_SETTINGS: case NGHTTP2_SETTINGS:
{ {
uint32_t max_conn = httpc->settings.max_concurrent_streams; uint32_t max_conn = httpc->settings.max_concurrent_streams;
DEBUGF(infof(conn->data, "Got SETTINGS for stream %x!\n", stream_id)); DEBUGF(infof(conn->data, "Got SETTINGS for stream %u!\n", stream_id));
httpc->settings.max_concurrent_streams = httpc->settings.max_concurrent_streams =
nghttp2_session_get_remote_settings( nghttp2_session_get_remote_settings(
session, NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS); session, NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS);
@ -320,7 +320,7 @@ static int on_frame_recv(nghttp2_session *session, const nghttp2_frame *frame,
} }
break; break;
default: default:
DEBUGF(infof(conn->data, "Got frame type %x for stream %x!\n", DEBUGF(infof(conn->data, "Got frame type %x for stream %u!\n",
frame->hd.type, stream_id)); frame->hd.type, stream_id));
break; break;
} }
@ -352,7 +352,7 @@ static int on_data_chunk_recv(nghttp2_session *session, uint8_t flags,
(void)flags; (void)flags;
(void)data; (void)data;
DEBUGF(infof(conn->data, "on_data_chunk_recv() " DEBUGF(infof(conn->data, "on_data_chunk_recv() "
"len = %u, stream %x\n", len, stream_id)); "len = %u, stream %u\n", len, stream_id));
DEBUGASSERT(stream_id); /* should never be a zero stream ID here */ DEBUGASSERT(stream_id); /* should never be a zero stream ID here */
@ -378,7 +378,7 @@ static int on_data_chunk_recv(nghttp2_session *session, uint8_t flags,
Curl_expire(data_s, 1); /* TODO: fix so that this can be set to 0 for Curl_expire(data_s, 1); /* TODO: fix so that this can be set to 0 for
immediately? */ immediately? */
DEBUGF(infof(data_s, "%zu data received for stream %x " DEBUGF(infof(data_s, "%zu data received for stream %u "
"(%zu left in buffer %p, total %zu)\n", "(%zu left in buffer %p, total %zu)\n",
nread, stream_id, nread, stream_id,
stream->len, stream->mem, stream->len, stream->mem,
@ -388,7 +388,7 @@ static int on_data_chunk_recv(nghttp2_session *session, uint8_t flags,
stream->pausedata = data + nread; stream->pausedata = data + nread;
stream->pauselen = len - nread; stream->pauselen = len - nread;
DEBUGF(infof(data_s, "NGHTTP2_ERR_PAUSE - %zu bytes out of buffer" DEBUGF(infof(data_s, "NGHTTP2_ERR_PAUSE - %zu bytes out of buffer"
", stream %x\n", ", stream %u\n",
len - nread, stream_id)); len - nread, stream_id));
conn->proto.httpc.pause_stream_id = stream_id; conn->proto.httpc.pause_stream_id = stream_id;
return NGHTTP2_ERR_PAUSE; return NGHTTP2_ERR_PAUSE;
@ -437,7 +437,7 @@ static int on_stream_close(nghttp2_session *session, int32_t stream_id,
struct HTTP *stream; struct HTTP *stream;
(void)session; (void)session;
(void)stream_id; (void)stream_id;
DEBUGF(infof(conn->data, "on_stream_close(), error_code = %d, stream %x\n", DEBUGF(infof(conn->data, "on_stream_close(), error_code = %d, stream %u\n",
error_code, stream_id)); error_code, stream_id));
if(stream_id) { if(stream_id) {
@ -462,7 +462,7 @@ static int on_stream_close(nghttp2_session *session, int32_t stream_id,
/* remove the entry from the hash as the stream is now gone */ /* remove the entry from the hash as the stream is now gone */
Curl_hash_delete(&conn->proto.httpc.streamsh, Curl_hash_delete(&conn->proto.httpc.streamsh,
&stream_id, sizeof(stream_id)); &stream_id, sizeof(stream_id));
DEBUGF(infof(conn->data, "Removed stream %x hash!\n", stream_id)); DEBUGF(infof(conn->data, "Removed stream %u hash!\n", stream_id));
} }
return 0; return 0;
} }
@ -602,7 +602,7 @@ static ssize_t data_source_read_callback(nghttp2_session *session,
if(!data_s) { if(!data_s) {
/* Receiving a Stream ID not in the hash should not happen, this is an /* Receiving a Stream ID not in the hash should not happen, this is an
internal error more than anything else! */ internal error more than anything else! */
failf(conn->data, "Asked for data to stream %x not in hash!", stream_id); failf(conn->data, "Asked for data to stream %u not in hash!", stream_id);
return NGHTTP2_ERR_CALLBACK_FAILURE; return NGHTTP2_ERR_CALLBACK_FAILURE;
} }
stream = data_s->req.protop; stream = data_s->req.protop;
@ -626,7 +626,7 @@ static ssize_t data_source_read_callback(nghttp2_session *session,
return NGHTTP2_ERR_DEFERRED; return NGHTTP2_ERR_DEFERRED;
DEBUGF(infof(data_s, "data_source_read_callback: " DEBUGF(infof(data_s, "data_source_read_callback: "
"returns %zu bytes stream %x\n", "returns %zu bytes stream %u\n",
nread, stream_id)); nread, stream_id));
return nread; return nread;
@ -780,7 +780,7 @@ static ssize_t http2_handle_stream_close(struct http_conn *httpc,
function. */ function. */
stream->closed = FALSE; stream->closed = FALSE;
if(stream->error_code != NGHTTP2_NO_ERROR) { if(stream->error_code != NGHTTP2_NO_ERROR) {
failf(data, "HTTP/2 stream %x was not closed cleanly: error_code = %d", failf(data, "HTTP/2 stream %u was not closed cleanly: error_code = %d",
stream->stream_id, stream->error_code); stream->stream_id, stream->error_code);
*err = CURLE_HTTP2; *err = CURLE_HTTP2;
return -1; return -1;
@ -838,11 +838,11 @@ static ssize_t http2_recv(struct connectdata *conn, int sockindex,
return ncopy; return ncopy;
} }
infof(data, "http2_recv: %d bytes buffer at %p (stream %x)\n", infof(data, "http2_recv: %d bytes buffer at %p (stream %u)\n",
len, mem, stream->stream_id); len, mem, stream->stream_id);
if((data->state.drain) && stream->memlen) { if((data->state.drain) && stream->memlen) {
DEBUGF(infof(data, "http2_recv: DRAIN %zu bytes stream %x!! (%p => %p)\n", DEBUGF(infof(data, "http2_recv: DRAIN %zu bytes stream %u!! (%p => %p)\n",
stream->memlen, stream->stream_id, stream->memlen, stream->stream_id,
stream->mem, mem)); stream->mem, mem));
if(mem != stream->mem) { if(mem != stream->mem) {
@ -862,14 +862,14 @@ static ssize_t http2_recv(struct connectdata *conn, int sockindex,
infof(data, "%zu data bytes written\n", nread); infof(data, "%zu data bytes written\n", nread);
if(stream->pauselen == 0) { if(stream->pauselen == 0) {
DEBUGF(infof(data, "Unpaused by stream %x\n", stream->stream_id)); DEBUGF(infof(data, "Unpaused by stream %u\n", stream->stream_id));
assert(httpc->pause_stream_id == stream->stream_id); assert(httpc->pause_stream_id == stream->stream_id);
httpc->pause_stream_id = 0; httpc->pause_stream_id = 0;
stream->pausedata = NULL; stream->pausedata = NULL;
stream->pauselen = 0; stream->pauselen = 0;
} }
infof(data, "http2_recv: returns unpaused %zd bytes on stream %x\n", infof(data, "http2_recv: returns unpaused %zd bytes on stream %u\n",
nread, stream->stream_id); nread, stream->stream_id);
return nread; return nread;
} }
@ -955,14 +955,14 @@ static ssize_t http2_recv(struct connectdata *conn, int sockindex,
} }
if(stream->memlen) { if(stream->memlen) {
ssize_t retlen = stream->memlen; ssize_t retlen = stream->memlen;
infof(data, "http2_recv: returns %zd for stream %x\n", infof(data, "http2_recv: returns %zd for stream %u\n",
retlen, stream->stream_id); retlen, stream->stream_id);
stream->memlen = 0; stream->memlen = 0;
if(httpc->pause_stream_id == stream->stream_id) { if(httpc->pause_stream_id == stream->stream_id) {
/* data for this stream is returned now, but this stream caused a pause /* data for this stream is returned now, but this stream caused a pause
already so we need it called again asap */ already so we need it called again asap */
DEBUGF(infof(data, "Data returned for PAUSED stream %x\n", DEBUGF(infof(data, "Data returned for PAUSED stream %u\n",
stream->stream_id)); stream->stream_id));
} }
else else
@ -976,7 +976,7 @@ static ssize_t http2_recv(struct connectdata *conn, int sockindex,
return http2_handle_stream_close(httpc, data, stream, err); return http2_handle_stream_close(httpc, data, stream, err);
} }
*err = CURLE_AGAIN; *err = CURLE_AGAIN;
DEBUGF(infof(data, "http2_recv returns AGAIN for stream %x\n", DEBUGF(infof(data, "http2_recv returns AGAIN for stream %u\n",
stream->stream_id)); stream->stream_id));
return -1; return -1;
} }
@ -1037,7 +1037,7 @@ static ssize_t http2_send(struct connectdata *conn, int sockindex,
nghttp2_session_resume_data(h2, stream->stream_id); nghttp2_session_resume_data(h2, stream->stream_id);
} }
DEBUGF(infof(conn->data, "http2_send returns %zu for stream %x\n", len, DEBUGF(infof(conn->data, "http2_send returns %zu for stream %u\n", len,
stream->stream_id)); stream->stream_id));
return len; return len;
} }