[libsoup] Use g_memory_output_stream_new_resizable()



commit d1ba9fcdadcd3a2e45a9cdc5aca9b6861601a6f4
Author: Patrick Griffis <pgriffis igalia com>
Date:   Fri Mar 5 12:19:07 2021 -0600

    Use g_memory_output_stream_new_resizable()

 libsoup/soup-session.c | 8 ++++----
 tests/server-test.c    | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/libsoup/soup-session.c b/libsoup/soup-session.c
index 6686afff..32178bd4 100644
--- a/libsoup/soup-session.c
+++ b/libsoup/soup-session.c
@@ -2964,7 +2964,7 @@ send_async_maybe_complete (SoupMessageQueueItem *item,
                GOutputStream *ostream;
 
                /* Gather the current message body... */
-               ostream = g_memory_output_stream_new (NULL, 0, g_realloc, g_free);
+               ostream = g_memory_output_stream_new_resizable ();
                g_object_set_data_full (G_OBJECT (item->task), "SoupSession:ostream",
                                        ostream, g_object_unref);
 
@@ -3365,7 +3365,7 @@ soup_session_send (SoupSession   *session,
                        break;
 
                /* Gather the current message body... */
-               ostream = g_memory_output_stream_new (NULL, 0, g_realloc, g_free);
+               ostream = g_memory_output_stream_new_resizable ();
                if (g_output_stream_splice (ostream, stream,
                                            G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE |
                                            G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET,
@@ -3452,7 +3452,7 @@ send_and_read_stream_ready_cb (SoupSession  *session,
                return;
        }
 
-       ostream = g_memory_output_stream_new (NULL, 0, g_realloc, g_free);
+       ostream = g_memory_output_stream_new_resizable ();
        g_output_stream_splice_async (ostream,
                                      stream,
                                      G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE |
@@ -3559,7 +3559,7 @@ soup_session_send_and_read (SoupSession  *session,
        if (!stream)
                return NULL;
 
-       ostream = g_memory_output_stream_new (NULL, 0, g_realloc, g_free);
+       ostream = g_memory_output_stream_new_resizable ();
        if (g_output_stream_splice (ostream,
                                    stream,
                                    G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE |
diff --git a/tests/server-test.c b/tests/server-test.c
index f0bc8ef0..61ada919 100644
--- a/tests/server-test.c
+++ b/tests/server-test.c
@@ -728,7 +728,7 @@ do_iostream_accept_test (void)
        soup_server_add_handler (server, NULL, mem_server_callback, NULL, NULL);
 
        input = g_memory_input_stream_new_from_data (req, sizeof(req), NULL);
-       output = g_memory_output_stream_new (NULL, 0, g_realloc, g_free);
+       output = g_memory_output_stream_new_resizable ();
        stream = g_test_io_stream_new (input, output);
 
        addr = g_inet_socket_address_new_from_string ("127.0.0.1", 0);


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