Mismatch between documentation and behavior for `SoupMessage::got-headers`
I am trying to use libsoup3 for async requests where I have to handle a 409, find the CSRF token, and then resend the message. In the documentation for SoupMessage::got-headers
it says:
If you cancel or requeue msg while processing this signal, then the current HTTP I/O will be stopped after this signal emission finished, and msg‘s connection will be closed. (If you need to requeue a message—eg, after handling authentication or redirection—it is usually better to requeue it from a SoupMessage::got-body handler rather than a SoupMessage::got-headers handler, so that the existing HTTP connection can be reused.)
However, when you do it this way cancelling actually does nothing. Once got-body
is signalled, soup_session_send_finish()
is called and I catch an error for a 409, which shouldn't happen. To fix this in my code, I switched to got-headers
and it works as expected. So, I think this portion of the docs is either very unclear at best or outright incorrect at worst.
I do not have a simple example but the code I am working with is here. Basically if I use got-body
then session_id_callback
is never reached.