[libsoup] Bug 785660 - add payload to Ping frames



commit f0c0f1a619b52ce7a5ca0430086e57133d969eb6
Author: David Woodhouse <dwmw amazon co uk>
Date:   Tue Aug 1 16:32:44 2017 +0100

    Bug 785660 - add payload to Ping frames
    
    Some servers seem to close the connection if we send a Ping frame without
    any payload. Send a static "libsoup" as payload each time.

 libsoup/soup-websocket-connection.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/libsoup/soup-websocket-connection.c b/libsoup/soup-websocket-connection.c
index c629b67..3d01e90 100644
--- a/libsoup/soup-websocket-connection.c
+++ b/libsoup/soup-websocket-connection.c
@@ -1816,9 +1816,12 @@ static gboolean
 on_queue_ping (gpointer user_data)
 {
        SoupWebsocketConnection *self = SOUP_WEBSOCKET_CONNECTION (user_data);
+       static const char ping_payload[] = "libsoup";
 
        g_debug ("sending ping message");
-       send_message (self, SOUP_WEBSOCKET_QUEUE_NORMAL, 0x09, NULL, 0);
+
+       send_message (self, SOUP_WEBSOCKET_QUEUE_NORMAL, 0x09,
+                     (guint8 *) ping_payload, strlen(ping_payload));
 
        return G_SOURCE_CONTINUE;
 }


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