Skip to content

base: fix invalid push/pop of handshake_context

Michael Catanzaro requested to merge mcatanzaro/#85 into master

If handshake_context is reused -- i.e., it is assigned to using g_main_context_ref_thread_default() rather than g_main_context_new() and g_main_context_push_thread_default() -- then we do not need to, and must not, pop it before emitting the accept-certificate callback. I was thinking that reffing the thread default context would increase its "reference count" on the stack, such that the pop call here would be paired with the ref and ultimately ignored. That's absolutely not how it works.

We'll invert the meaning of sync_handshake_completed to become sync_handshake_in_progress so that we can reuse it here.

Fixes #85 (closed)

Edited by Michael Catanzaro

Merge request reports