[libsoup] Fix soup_session_get_async_result_message() with soup_session_send_and_read_async()



commit bc0acf4c66da7288eaf2b5e54375021a051d236e
Author: Patrick Griffis <pgriffis igalia com>
Date:   Fri Mar 12 12:48:09 2021 -0600

    Fix soup_session_get_async_result_message() with soup_session_send_and_read_async()

 libsoup/soup-session.c | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/libsoup/soup-session.c b/libsoup/soup-session.c
index 32178bd4..5f312020 100644
--- a/libsoup/soup-session.c
+++ b/libsoup/soup-session.c
@@ -3445,6 +3445,11 @@ send_and_read_stream_ready_cb (SoupSession  *session,
        GOutputStream *ostream;
        GError *error = NULL;
 
+        // In order for soup_session_get_async_result_message() to work it must
+        // have the task data for the task it wrapped
+        SoupMessageQueueItem *item = g_task_get_task_data (G_TASK (result));
+        g_task_set_task_data (task, soup_message_queue_item_ref (item), 
(GDestroyNotify)soup_message_queue_item_unref);
+
        stream = soup_session_send_finish (session, result, &error);
        if (!stream) {
                g_task_return_error (task, error);


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