gsocketclient: Handle cancellation between CONNECTING and CONNECTED
authorPhilip Withnall <philip.withnall@collabora.co.uk>
Thu, 21 Aug 2014 18:00:13 +0000 (19:00 +0100)
committerPhilip Withnall <philip.withnall@collabora.co.uk>
Fri, 22 Aug 2014 18:11:26 +0000 (19:11 +0100)
commitcb320cb5feb78a5a06651d3223914d9099a6f212
treefb8f5b8db19b41c1edfa10c446a6cd730d6d34d8
parent607d5a785891729889f1606e8d38edcc7332dfa1
gsocketclient: Handle cancellation between CONNECTING and CONNECTED

If a g_socket_client_connect_async() operation is cancelled between the
CONNECTING and CONNECTED events (i.e. while in the
g_socket_connection_connect_async() call), the code in
g_socket_client_connected_callback() would previously unconditionally
loop round and try the next socket address from the address enumerator
(by calling enumerator_next_async()). This would correctly handle the
cancellation and return from the overall task — but not before emitting
a spurious RESOLVING event.

Avoid emitting the spurious RESOLVING event by explicitly handling
cancellation at the beginning of g_socket_client_connected_callback().

https://bugzilla.gnome.org/show_bug.cgi?id=735179
gio/gsocketclient.c