diff options
author | Carlos Garcia Campos <cgarcia@igalia.com> | 2021-05-26 10:31:08 +0200 |
---|---|---|
committer | Carlos Garcia Campos <cgarcia@igalia.com> | 2021-05-26 16:05:11 +0200 |
commit | dd23cc17d5b2cd27708ff30944201f6c00002e6d (patch) | |
tree | 90b8bc46df5bef7d8e11a11c60976fa9e6f2c7d5 /libsoup/http2 | |
parent | 8a0dab1a4254c3f0455eea69a2b0f9249b737310 (diff) | |
download | libsoup-dd23cc17d5b2cd27708ff30944201f6c00002e6d.tar.gz |
io-http2: improve closing stream debug messages
Diffstat (limited to 'libsoup/http2')
-rw-r--r-- | libsoup/http2/soup-client-message-io-http2.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/libsoup/http2/soup-client-message-io-http2.c b/libsoup/http2/soup-client-message-io-http2.c index 640c80f4..37609334 100644 --- a/libsoup/http2/soup-client-message-io-http2.c +++ b/libsoup/http2/soup-client-message-io-http2.c @@ -490,15 +490,12 @@ on_frame_send_callback (nghttp2_session *session, { SoupHTTP2MessageData *data = nghttp2_session_get_stream_user_data (session, frame->hd.stream_id); - if (!data) { - h2_debug (user_data, NULL, "[SEND] [%s]", frame_type_to_string (frame->hd.type)); - return 0; - } - switch (frame->hd.type) { case NGHTTP2_HEADERS: + g_assert (data); h2_debug (user_data, data, "[SEND] [HEADERS] finished=%d", (frame->hd.flags & NGHTTP2_FLAG_END_HEADERS) ? 1 : 0); + if (data->metrics) data->metrics->request_header_bytes_sent += frame->hd.length + FRAME_HEADER_SIZE; @@ -511,6 +508,7 @@ on_frame_send_callback (nghttp2_session *session, } break; case NGHTTP2_DATA: + g_assert (data); if (data->state < STATE_WRITE_DATA) advance_state_from (data, STATE_WRITE_HEADERS, STATE_WRITE_DATA); @@ -527,8 +525,11 @@ on_frame_send_callback (nghttp2_session *session, soup_message_wrote_body (data->msg); } break; + case NGHTTP2_RST_STREAM: + h2_debug (user_data, data, "[SEND] [RST_STREAM] stream_id=%u", frame->hd.stream_id); + break; default: - h2_debug (user_data, NULL, "[SEND] [%s]", frame_type_to_string (frame->hd.type)); + h2_debug (user_data, data, "[SEND] [%s]", frame_type_to_string (frame->hd.type)); break; } @@ -555,7 +556,9 @@ on_stream_close_callback (nghttp2_session *session, uint32_t error_code, void *user_data) { - g_debug ("[S%d] [SESSION] Closed: %s", stream_id, nghttp2_http2_strerror (error_code)); + SoupHTTP2MessageData *data = nghttp2_session_get_stream_user_data (session, stream_id); + h2_debug (user_data, data, "[SESSION] Closed: %s", nghttp2_http2_strerror (error_code)); + return 0; } |