[libsoup/carlosgc/web-sockets: 1/3] WebSockets: message never finishes when handshake fails



commit 1f6ece32f729be3fa08c6431c58339e62e73c257
Author: Carlos Garcia Campos <cgarcia igalia com>
Date:   Mon Jun 17 15:10:59 2019 +0200

    WebSockets: message never finishes when handshake fails
    
    When soup_websocket_client_verify_handshake() returns TRUE, the
    message connection is stolen and soup_message_io_steal() is called for
    the message, making the message to move to FINISHING state. However,
    when it returns FALSE, the message stays in RUNNING state forever. We
    should call soup_message_io_finished() in that case to ensure the
    messages transitions to FINISHING state.

 libsoup/soup-session.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/libsoup/soup-session.c b/libsoup/soup-session.c
index ae340b9c..f4a68507 100644
--- a/libsoup/soup-session.c
+++ b/libsoup/soup-session.c
@@ -4815,8 +4815,10 @@ websocket_connect_async_stop (SoupMessage *msg, gpointer user_data)
                g_object_unref (stream);
 
                g_task_return_pointer (task, client, g_object_unref);
-       } else
+       } else {
+               soup_message_io_finished (item->msg);
                g_task_return_error (task, error);
+       }
        g_object_unref (task);
 }
 


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