[libsoup] io-http2: reset the data source buffer size on eof



commit c83062d16b04bdcfeb6bb12859ce937ebaa69ba8
Author: Carlos Garcia Campos <cgarcia igalia com>
Date:   Mon May 24 16:04:42 2021 +0200

    io-http2: reset the data source buffer size on eof
    
    Otherwise on next source data callback we would still be trying to send
    data.

 libsoup/http2/soup-client-message-io-http2.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/libsoup/http2/soup-client-message-io-http2.c b/libsoup/http2/soup-client-message-io-http2.c
index e5a640d3..4eaf4d43 100644
--- a/libsoup/http2/soup-client-message-io-http2.c
+++ b/libsoup/http2/soup-client-message-io-http2.c
@@ -589,9 +589,10 @@ on_data_read (GInputStream *source,
         if (read < 0) {
                 g_byte_array_set_size (data->data_source_buffer, 0);
                 data->data_source_error = g_steal_pointer (&error);
-        } else if (read == 0)
+        } else if (read == 0) {
+                g_byte_array_set_size (data->data_source_buffer, 0);
                 data->data_source_eof = TRUE;
-        else
+        } else
                 g_byte_array_set_size (data->data_source_buffer, read);
 
         h2_debug (data->io, data, "[SEND_BODY] Resuming send");


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