Skip to content

gsocketclient: Refactor g_socket_client_connect_async()

It is possible for multiple ConnectionAttempts to set data in the shared GSocketClientAsyncConnectData which can do terrible things like bypass a set proxy.

This change keeps as much state as possible inside the ConnectionAttempt and keeps it alive until the very end of connecting.

Note there are no new tests because it is quite tricky to simulate all of the conditions to hit these cases. That will have to be investigated in far more depth later.

I spent far more time trying to test this than on the fix, so this could certainly use some solid review (CC @mcatanzaro)

Fixes #1871 (closed) Fixes #1989 (closed)

Edited by Patrick Griffis

Merge request reports