Skip to content

Make handshake ops ignore cancellation

Michael Catanzaro requested to merge mcatanzaro/handshake-op-cancel into master

This is bad, because it means the operation will no longer complete immediately if cancelled by the API user. But it's better than crashing, which is what is happening now. The underlying handshake operation is synchronous, and this is tough to change, so we currently use g_task_set_return_on_cancel() to fake it: this lets the API user think the operation has completed, even if it's still running on the handshake thread. Problem is this is broken and cannot be fixed easily: glib-networking is not actually prepared for the task to finish early like this. For now, ignoring cancellation is the most practical solution to avoid crashes.

Of course this is not a good long-term solution. I have added a bullet point to #89 in order to ensure I don't forget that we need to fix cancellation.

Fixes #97 (closed), fixes #176 (closed)

Merge request reports