gsocketclient: run timeout source on the task's main context

This shouldn't make any difference, because this code should only ever
be running in the main context that was thread-default at the time the
task was created, so it should already match the task's context. But
let's make sure, just in case.
This commit is contained in:
Michael Catanzaro 2020-01-04 20:46:25 -06:00 committed by Philip Withnall
parent 027c3f8d59
commit cc3cf6b8b2

View File

@ -1794,7 +1794,7 @@ g_socket_client_enumerator_callback (GObject *object,
attempt->connection = (GIOStream *)g_socket_connection_factory_create_connection (socket);
attempt->timeout_source = g_timeout_source_new (HAPPY_EYEBALLS_CONNECTION_ATTEMPT_TIMEOUT_MS);
g_source_set_callback (attempt->timeout_source, on_connection_attempt_timeout, attempt, NULL);
g_source_attach (attempt->timeout_source, g_main_context_get_thread_default ());
g_source_attach (attempt->timeout_source, g_task_get_context (data->task));
data->connection_attempts = g_slist_append (data->connection_attempts, attempt);
if (g_task_get_cancellable (data->task))