[libsoup] Fix soup_client_message_io_in_progress implementations



commit 9623314829af0ede663a7c6ff89ccd3350f4cee9
Author: Carlos Garcia Campos <cgarcia igalia com>
Date:   Wed May 19 11:08:47 2021 +0200

    Fix soup_client_message_io_in_progress implementations
    
    We consider it's in progress if we have io data for the given message in
    both http1 and http2

 libsoup/http1/soup-client-message-io-http1.c | 5 +++--
 libsoup/http2/soup-client-message-io-http2.c | 9 ++-------
 2 files changed, 5 insertions(+), 9 deletions(-)
---
diff --git a/libsoup/http1/soup-client-message-io-http1.c b/libsoup/http1/soup-client-message-io-http1.c
index bdf184d1..cb181e30 100644
--- a/libsoup/http1/soup-client-message-io-http1.c
+++ b/libsoup/http1/soup-client-message-io-http1.c
@@ -1102,8 +1102,9 @@ static gboolean
 soup_client_message_io_http1_in_progress (SoupClientMessageIO *iface,
                                           SoupMessage         *msg)
 {
-        /* In progress as long as object is alive */
-        return TRUE;
+        SoupClientMessageIOHTTP1 *io = (SoupClientMessageIOHTTP1 *)iface;
+
+        return io->msg_io != NULL;
 }
 
 static gboolean
diff --git a/libsoup/http2/soup-client-message-io-http2.c b/libsoup/http2/soup-client-message-io-http2.c
index e3a0c647..32b5c888 100644
--- a/libsoup/http2/soup-client-message-io-http2.c
+++ b/libsoup/http2/soup-client-message-io-http2.c
@@ -882,11 +882,7 @@ static SoupHTTP2MessageData *
 get_data_for_message (SoupClientMessageIOHTTP2 *io,
                       SoupMessage              *msg)
 {
-        SoupHTTP2MessageData *data = g_hash_table_lookup (io->messages, msg);
-
-        g_warn_if_fail (data != NULL);
-
-        return data;
+        return g_hash_table_lookup (io->messages, msg);
 }
 
 static void
@@ -964,9 +960,8 @@ soup_client_message_io_http2_in_progress (SoupClientMessageIO *iface,
                                           SoupMessage         *msg)
 {
         SoupClientMessageIOHTTP2 *io = (SoupClientMessageIOHTTP2 *)iface;
-        SoupHTTP2MessageData *data = get_data_for_message (io, msg);
 
-        return data->state < STATE_WRITE_DONE;
+        return get_data_for_message (io, msg) != NULL;
 }
 
 static gboolean


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