xpra icon
Bug tracker and wiki

This bug tracker and wiki are being discontinued
please use https://github.com/Xpra-org/xpra instead.

Opened 10 years ago

Closed 10 years ago

Last modified 16 months 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:
Keywords: Cc:


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 (3)

comment:1 Changed 10 years ago by Antoine Martin

Resolution: fixed
Status: newclosed

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

comment:2 Changed 10 years ago by Antoine Martin

Component: servercore
Milestone: current0.0.7.x

comment:3 Changed 16 months ago by migration script

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

Note: See TracTickets for help on using tickets.