xpra icon
Bug tracker and wiki

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#54 closed defect (fixed)

enable_deflate is racy - hard to fix

Reported by: Antoine Martin Owned by: Antoine Martin
Priority: major Milestone: 0.0.7.x
Component: core Version: 0.0.7.34
Keywords: Cc:

Description

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..

Change History (2)

comment:1 Changed 9 years ago by Antoine Martin

Resolution: fixed
Status: newclosed

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

comment:2 Changed 9 years ago by Antoine Martin

Component: servercore
Milestone: current0.0.7.x
Version: 0.0.7.34
Note: See TracTickets for help on using tickets.