Skip to content

Refactor g_socket_client_connect_async()

Michael Catanzaro requested to merge cherry-pick-2722620e into glib-2-62

This is a fairly large refactoring. The highlights are:

  • Removing in-progress connections/addresses from GSocketClientAsyncConnectData:

    This caused issues where multiple ConnectionAttempt's would step over eachother and modify shared state causing bugs like accidentally bypassing a set proxy.

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

  • Cancelling address enumeration on error/completion

  • Queuing successful TCP connections and doing application layer work serially:

    This is more in the spirit of Happy Eyeballs but it also greatly simplifies the flow of connection handling so fewer tasks are happening in parallel when they don't need to be.

    The behavior also should more closely match that of g_socket_client_connect().

  • Better track the state of address enumeration:

    Previously we were over eager to treat enumeration finishing as an error.

    Fixes #1872 (closed) See also #1982 (closed)

  • Add more detailed documentation and logging.

Closes #1995 (closed)

(cherry picked from commit 2722620e)

Merge request reports