summaryrefslogtreecommitdiff
path: root/libsoup
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw@amazon.co.uk>2017-08-01 16:32:44 +0100
committerDavid Woodhouse <dwmw2@infradead.org>2017-08-07 17:24:17 +0100
commitf0c0f1a619b52ce7a5ca0430086e57133d969eb6 (patch)
tree4e9f91fb14344a3c961dab064a1f358b02663247 /libsoup
parentd6e959bfb4824d7e9f12b0c744a1154f0a89ee69 (diff)
downloadlibsoup-f0c0f1a619b52ce7a5ca0430086e57133d969eb6.tar.gz
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.
Diffstat (limited to 'libsoup')
-rw-r--r--libsoup/soup-websocket-connection.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libsoup/soup-websocket-connection.c b/libsoup/soup-websocket-connection.c
index c629b67e..3d01e905 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;
}