Aurena client won't work with libsoup 2.40
Since aurena client is based on got-chunk signal in libsoup, and that got-chunk not longer always return an HTTP chunk, we end up with corrupted JSON block in the client. I think the best fix would be to change the protocol to use persistant connection and send a new request after having received a response.
libsoup doc: "Emitted after receiving a chunk of a message body. Note that "chunk" in this context means any subpiece of the body, not necessarily the specific HTTP 1.1 chunks sent by the other side."
I would like it if libsoup would confirm how one is supposed to handle chunked encoding then. The docs suck in that regard.
Well, chunks are supposed to be abstract concept, a continuous stream. HTTP stack does not have to expose each chunked well split to be an HTTP stack. got-chunk signal is there to allow low mem streaming. As of any streaming, one option would be to add a parser. In this case, we send text base JSON, we could have a simple delimiter between JSON messages (i.e. CRLLF), and split the JSON messages correctly base on that.
I was thinking about this some more last night. I'd like to make the event stream use Websockets everywhere possible, and fall back to a long-polling connection as you suggest when it's not. Getting that working would enable the web UI in places that don't support websockets, while keeping the clients using a persistent connection that doesn't rely on got-chunk.
It does mean implementing more websockets stuff though.