Xpra: Ticket #54: enable_deflate is racy - hard to fix

The problem is that the read/write network code is threaded (and has been for a while), the call that will end up enabling the compressor/decompressor will fire from the main thread, usually after the _read_parse_thread_loop iteration has finished (via a main_thread_call).

This is not safe, it just happens to work because the packet that enables compression is the hello packet and nothing comes immediately after it, but if something did it may well end up in the read_decoder buffer without going through the decompression which should have been enabled. And at that point, everything would break (and exit with a GIBBERISH error)

The only reliable fix that I can think of would be to add yet another "special" packet header (similar to the one that provides the packet-size feature) to turn compression on (or off even). This would allow us to change mode from within the read parse loop rather than trying to patch things up later on from another thread..



Sat, 07 Jan 2012 18:51:13 GMT - Antoine Martin: status changed; resolution set

done in r409 with "set_deflate" packet and corresponding UI.


Mon, 20 Feb 2012 19:26:08 GMT - Antoine Martin: component, milestone changed; version set


Sat, 23 Jan 2021 04:44:17 GMT - migration script:

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/54