diff options
author | Philip Withnall <pwithnall@endlessos.org> | 2023-04-13 12:32:04 +0100 |
---|---|---|
committer | Philip Withnall <pwithnall@endlessos.org> | 2023-04-13 13:23:59 +0100 |
commit | 48b3b61154389b377f6cd20ea72e57b62c9256e8 (patch) | |
tree | 9d8825705a059785215550d06e0c52ed03f732f5 /libsoup/soup-websocket-connection.c | |
parent | 4d12c3e5769952ad0bfa318f4569d90a9d9a5085 (diff) | |
download | libsoup-48b3b61154389b377f6cd20ea72e57b62c9256e8.tar.gz |
lib: Add names to various GSourceslibsoup-2-74
This helps in identifying what’s attached to a `GMainContext` when
debugging runtime problems with libsoup.
The names added in `soup-misc.c` are fairly rough; if they turn out to
not be specific enough, those methods could be changed to accept a
`const gchar *name` argument so the caller can provide a more specific
name.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
Diffstat (limited to 'libsoup/soup-websocket-connection.c')
-rw-r--r-- | libsoup/soup-websocket-connection.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/libsoup/soup-websocket-connection.c b/libsoup/soup-websocket-connection.c index a4095e1c..6d136d41 100644 --- a/libsoup/soup-websocket-connection.c +++ b/libsoup/soup-websocket-connection.c @@ -306,6 +306,11 @@ soup_websocket_connection_start_input_source (SoupWebsocketConnection *self) return; pv->input_source = g_pollable_input_stream_create_source (pv->input, NULL); +#if GLIB_CHECK_VERSION(2, 70, 0) + g_source_set_static_name (pv->input_source, "SoupWebsocketConnection input"); +#else + g_source_set_name (pv->input_source, "SoupWebsocketConnection input"); +#endif g_source_set_callback (pv->input_source, (GSourceFunc)on_web_socket_input, self, NULL); g_source_attach (pv->input_source, pv->main_context); } @@ -332,6 +337,11 @@ soup_websocket_connection_start_output_source (SoupWebsocketConnection *self) return; pv->output_source = g_pollable_output_stream_create_source (pv->output, NULL); +#if GLIB_CHECK_VERSION(2, 70, 0) + g_source_set_static_name (pv->output_source, "SoupWebsocketConnection output"); +#else + g_source_set_name (pv->output_source, "SoupWebsocketConnection output"); +#endif g_source_set_callback (pv->output_source, (GSourceFunc)on_web_socket_output, self, NULL); g_source_attach (pv->output_source, pv->main_context); } @@ -444,6 +454,11 @@ close_io_after_timeout (SoupWebsocketConnection *self) g_debug ("waiting %d seconds for peer to close io", timeout); pv->close_timeout = g_timeout_source_new_seconds (timeout); +#if GLIB_CHECK_VERSION(2, 70, 0) + g_source_set_static_name (pv->close_timeout, "SoupWebsocketConnection close timeout"); +#else + g_source_set_name (pv->close_timeout, "SoupWebsocketConnection close timeout"); +#endif g_source_set_callback (pv->close_timeout, on_timeout_close_io, self, NULL); g_source_attach (pv->close_timeout, pv->main_context); } @@ -2207,6 +2222,11 @@ soup_websocket_connection_set_keepalive_interval (SoupWebsocketConnection *self, if (interval > 0) { pv->keepalive_timeout = g_timeout_source_new_seconds (interval); +#if GLIB_CHECK_VERSION(2, 70, 0) + g_source_set_static_name (pv->keepalive_timeout, "SoupWebsocketConnection keepalive timeout"); +#else + g_source_set_name (pv->keepalive_timeout, "SoupWebsocketConnection keepalive timeout"); +#endif g_source_set_callback (pv->keepalive_timeout, on_queue_ping, self, NULL); g_source_attach (pv->keepalive_timeout, pv->main_context); } |