Skip to content

Commit

Permalink
http2: debug log when receiving unexpected stream_id
Browse files Browse the repository at this point in the history
  • Loading branch information
bagder committed May 18, 2015
1 parent d6440d7 commit 47caff7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/http2.c
Expand Up @@ -300,6 +300,9 @@ static int on_data_chunk_recv(nghttp2_session *session, uint8_t flags,
"len = %u, stream = %x\n", len, stream_id));

if(stream_id != stream->stream_id) {
DEBUGF(infof(conn->data, "on_data_chunk_recv() "
"got stream %x, expected stream %x\n",
stream_id, stream->stream_id));
return 0;
}

Expand Down Expand Up @@ -363,6 +366,9 @@ static int on_stream_close(nghttp2_session *session, int32_t stream_id,
error_code));

if(stream_id != stream->stream_id) {
DEBUGF(infof(conn->data, "on_stream_close() "
"got stream %x, expected stream %x\n",
stream_id, stream->stream_id));
return 0;
}

Expand Down Expand Up @@ -435,6 +441,9 @@ static int on_header(nghttp2_session *session, const nghttp2_frame *frame,
}

if(frame->hd.stream_id != stream->stream_id) {
DEBUGF(infof(conn->data, "on_header() "
"got stream %x, expected stream %x\n",
frame->hd.stream_id, stream->stream_id));
return 0;
}

Expand Down Expand Up @@ -946,6 +955,7 @@ static ssize_t http2_send(struct connectdata *conn, int sockindex,
free(nva);

if(stream_id < 0) {
DEBUGF(infof(conn->data, "http2_send() send error\n"));
*err = CURLE_SEND_ERROR;
return -1;
}
Expand Down

0 comments on commit 47caff7

Please sign in to comment.