[libsoup/carlosgc/http2-post-data-read-debug-message] http2: move debug message about request body data read after early return




commit 6370e19560c71b2201bcfe33501e6543af7c264e
Author: Carlos Garcia Campos <cgarcia igalia com>
Date:   Wed Jun 1 12:46:26 2022 +0200

    http2: move debug message about request body data read after early return
    
    In case of cancellation the SoupHTTP2MessageData might have already been
    destroyed.

 libsoup/http2/soup-client-message-io-http2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/libsoup/http2/soup-client-message-io-http2.c b/libsoup/http2/soup-client-message-io-http2.c
index 3164fa06..9d1ea3ec 100644
--- a/libsoup/http2/soup-client-message-io-http2.c
+++ b/libsoup/http2/soup-client-message-io-http2.c
@@ -999,8 +999,6 @@ on_data_read (GInputStream *source,
         GError *error = NULL;
         gssize read = g_input_stream_read_finish (source, res, &error);
 
-        h2_debug (data->io, data, "[SEND_BODY] Read %zd", read);
-
         /* This operation may have outlived the message data in which
            case this will have been cancelled. */
         if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
@@ -1008,6 +1006,8 @@ on_data_read (GInputStream *source,
                 return;
         }
 
+        h2_debug (data->io, data, "[SEND_BODY] Read %zd", read);
+
         if (read < 0) {
                 g_byte_array_set_size (data->data_source_buffer, 0);
                 data->data_source_error = g_steal_pointer (&error);


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