#54 closed defect (fixed)
enable_deflate is racy - hard to fix
| Reported by: | totaam | Owned by: | antoine |
|---|---|---|---|
| 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 17 months ago by totaam
- Resolution set to fixed
- Status changed from new to closed
comment:2 Changed 15 months ago by totaam
- Component changed from server to core
- Milestone changed from current to 0.0.7.x
- Version set to 0.0.7.34
done in r409 with "set_deflate" packet and corresponding UI.