gsocketclient: Track whether the connection attempt delay is reached

Just for debugging purposes, track whether the Connection Attempt Delay
(https://datatracker.ietf.org/doc/html/rfc8305#section-8) has been
reached for each attempt.

This makes it a bit easier to diagnose `GSocketClient` problems in a
debugger.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
This commit is contained in:
Philip Withnall 2023-11-29 16:18:00 +00:00
parent ac6864ded7
commit f5f418b057

View File

@ -1542,6 +1542,7 @@ typedef struct
GProxyAddress *proxy_addr;
GSocketClientAsyncConnectData *data; /* unowned */
GSource *delay_timeout_source; /* (owned) */
gboolean delay_reached;
GCancellable *cancellable;
GCancellable *task_cancellable; /* (owned); this is equal to g_task_get_cancellable (ConnectionAttempt.data->task), but with a longer lifetime */
gulong cancelled_id;
@ -1985,6 +1986,9 @@ on_connection_attempt_delay_reached (gpointer data)
{
ConnectionAttempt *attempt = data;
g_assert (!attempt->delay_reached);
attempt->delay_reached = TRUE;
if (!attempt->data->enumeration_completed)
{
g_debug ("GSocketClient: Connection attempt delay reached, trying another enumeration");