After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 735179 - gsocketclient: Handle cancellation between CONNECTING and CONNECTED
gsocketclient: Handle cancellation between CONNECTING and CONNECTED
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: network
unspecified
Other All
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2014-08-21 18:03 UTC by Philip Withnall
Modified: 2014-08-22 18:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gsocketclient: Handle cancellation between CONNECTING and CONNECTED (1.56 KB, patch)
2014-08-21 18:03 UTC, Philip Withnall
committed Details | Review

Description Philip Withnall 2014-08-21 18:03:04 UTC
Trivial patch attached.
Comment 1 Philip Withnall 2014-08-21 18:03:07 UTC
Created attachment 284121 [details] [review]
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().
Comment 2 Philip Withnall 2014-08-22 18:12:11 UTC
Thanks for the fast review.

Attachment 284121 [details] pushed as cb320cb - gsocketclient: Handle cancellation between CONNECTING and CONNECTED