[libsoup/carlosgc/http2-reset-closed-stream: 2/2] http2: do not send RST_STREAM for already closed sreams




commit 42d36a1d1ee498a16ef57b60b445a18ccb8cba40
Author: Carlos Garcia Campos <cgarcia igalia com>
Date:   Tue Aug 30 12:41:39 2022 +0200

    http2: do not send RST_STREAM for already closed sreams

 libsoup/http2/soup-client-message-io-http2.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/libsoup/http2/soup-client-message-io-http2.c b/libsoup/http2/soup-client-message-io-http2.c
index cb4c65d7..4238d64d 100644
--- a/libsoup/http2/soup-client-message-io-http2.c
+++ b/libsoup/http2/soup-client-message-io-http2.c
@@ -1336,6 +1336,7 @@ soup_client_message_io_http2_finished (SoupClientMessageIO *iface,
        SoupMessageIOCompletionFn completion_cb;
        gpointer completion_data;
         SoupMessageIOCompletion completion;
+        gboolean is_closed;
 
         data = get_data_for_message (io, msg);
 
@@ -1348,9 +1349,10 @@ soup_client_message_io_http2_finished (SoupClientMessageIO *iface,
 
        g_object_ref (msg);
 
+        is_closed = nghttp2_session_get_stream_user_data (io->session, data->stream_id) == NULL;
         nghttp2_session_set_stream_user_data (io->session, data->stream_id, NULL);
 
-        if (!io->is_shutdown) {
+        if (!io->is_shutdown && !is_closed) {
                 SoupConnection *conn;
 
                 NGCHECK (nghttp2_submit_rst_stream (io->session, NGHTTP2_FLAG_NONE, data->stream_id,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]