fix(pdu): set COMPRESSION_USED on the FastPath update header when compressed#1382
Merged
Benoît Cortier (CBenoit) merged 1 commit intoJun 26, 2026
Conversation
…pressed FastPathUpdatePdu::encode wrote the update header byte before setting the COMPRESSION_USED bit, so a PDU encoded with compression flags emitted the trailing compression flags byte but never marked it in the header. The decoder keys on that bit to decide whether to consume the compression byte, so a compressed FastPath update did not round-trip: decode read the length field from the wrong offset and failed with NotEnoughBytes. Set the bit before writing the header, and add a round-trip test for the compressed case.
There was a problem hiding this comment.
Pull request overview
Fixes FastPath update PDU encoding so the update header correctly advertises the presence of the trailing compression flags byte when compression_flags is set, restoring encode/decode round-tripping for compressed FastPath updates in ironrdp-pdu.
Changes:
- Set the
COMPRESSION_USEDbit on the FastPath update header before writing the header byte inFastPathUpdatePdu::encode. - Add a regression test ensuring a compressed FastPath update PDU round-trips through encode/decode.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| crates/ironrdp-pdu/src/basic_output/fast_path/mod.rs | Fixes header bit emission so decode consumes the compression flags byte correctly. |
| crates/ironrdp-pdu/src/basic_output/fast_path/tests.rs | Adds a round-trip test covering the compressed FastPath update case. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Benoît Cortier (CBenoit)
approved these changes
Jun 26, 2026
Benoît Cortier (CBenoit)
left a comment
Member
There was a problem hiding this comment.
Good catch! Thank you!
3f96d00
into
Devolutions:master
21 checks passed
David T. Martel (David-Martel)
pushed a commit
to David-Martel/IronRDP
that referenced
this pull request
Jul 4, 2026
…pressed (Devolutions#1382) (cherry picked from commit 3f96d00)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
FastPathUpdatePdu::encodewrites the update header byte before setting theCOMPRESSION_USEDbit, so a PDU encoded withcompression_flagsset emits the trailing compression flags byte but never marks it in the header.FastPathUpdatePdu::decodekeys on that bit (bits 6..7 of the update header) to decide whether to consume the compression flags byte. With the bit clear, it skips that byte and reads the data length from the wrong offset, so a compressed FastPath update does not round-trip through encode/decode.This is currently latent: nothing in the workspace encodes a compressed fast-path output PDU (the server only decompresses, on the client side), so the path is never exercised. It surfaces as soon as anything does (it turned up while writing a bulk-decompression round-trip test).
The fix sets the bit on the header before it is written, and adds a round-trip test (
compressed_update_round_trips) covering the compressed case.