Skip to content

gtlsconnection: use a vfunc to implement get_negotiated_protocol()

Michael Catanzaro requested to merge mcatanzaro/#2393 into main

The current code is unsafe to use from multiple threads at once. GIOStream functions like this are supposed to be semi-threadsafe. It's allowed for them to be called on both a reader thread and a writer thread at the same time. Of course, it's still tricky and dangerous, because it's only really threadsafe if the handshake has finished, and API users have no plausible way to know that because the API does not require performing an explicit handshake operation. But that's a glib-networking problem. We can at least avoid the most obvious threadsafety issue here in the API layer.

Note that we'll need to implement the new vfunc in glib-networking for this to actually work.

Fixes #2393 (closed)

Merge request reports