The SASL authentication code can assert in wocky_auth_registry_success_async_func() (priv->handler is NULL) if we get disconnected while authenticating. What I think is happening is: * sasl_auth_stanza_sent() is called; * this calles wocky_xmpp_connection_recv_stanza_async() passing sasl_auth_stanza_received() as callback; * the connection gets disconnected; * cleanup happens; * after this we still receive the stanza; * sasl_auth_stanza_received is called; * we handle the stanze, but things go wrong as we already did the cleanup.
Branch ready for review. Senko is working on a test for this in the meantime.
It'd be nice to move this new check to after the “is it a stream error?” check, so that we don't throw away information. (In existing code, wocky_xmpp_connection_recv_stanza_finish() is called right before stream_error(), and no GError ** is passed into it. So we throw away a perfectly good error, and then synthesise a new, content-free one…) But functionally, your analysis seems sensible, and this should fix that bug.
I've merged the fixed version of the patch; thanks! <http://cgit.freedesktop.org/wocky/commit/?id=683d2cf1c5d4095b9413442d4cafb4e850c47952>
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.