-
Notifications
You must be signed in to change notification settings - Fork 164
feat(zgfx): add segment wrapping utilities #1076
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
ae5c877 to
98f8205
Compare
98f8205 to
956cdd5
Compare
|
Since this is just the scaffolding, I'm going to go ahead and submit the core compression PR so you can see the whole package. |
Add wrapper.rs providing ZGFX segment framing utilities for both uncompressed and compressed data: - wrap_uncompressed(): Wraps raw data in ZGFX segment format - wrap_compressed(): Wraps ZGFX-compressed data with COMPRESSED flag Supports both single segments (≤65535 bytes) and multipart segments for larger data. Fully compliant with MS-RDPEGFX specification. This enables server implementations to send EGFX PDUs without compression while maintaining protocol compliance. Refs: Devolutions#1067
956cdd5 to
dc82d37
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Adds server-side ZGFX (RDP8) segment framing helpers to produce spec-shaped ZGFX “segmented data” PDUs, primarily for sending EGFX payloads without compression.
Changes:
- Introduces
wrap_uncompressed()to wrap raw bytes into single or multipart ZGFX segmented PDUs. - Introduces
wrap_compressed()to wrap already-compressed payloads with the COMPRESSED flag set. - Exposes the new wrapper helpers via
ironrdp_graphics::zgfx.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
crates/ironrdp-graphics/src/zgfx/wrapper.rs |
New ZGFX segment wrapping implementation plus unit tests (mostly for uncompressed). |
crates/ironrdp-graphics/src/zgfx/mod.rs |
Wires the wrapper module and re-exports wrap_uncompressed / wrap_compressed. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
CBenoit
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me overall, but can you double check Copilot’s comments? Thanks!
Yes I'm wading through it now. Thanks. |
- Restrict wrap_compressed() to single-segment only — a compressed bitstream can't be split at arbitrary byte boundaries - Remove intermediate Vec allocation in multipart path - Add tests for compressed wrapping and oversized rejection - Update module docs to reflect both compressed and uncompressed support
|
OK I think it's done now. Thanks. |
Adds ZGFX segment wrapping utilities for encoding data in RDP8 format.
Summary
wrap_uncompressed(): Wraps raw data in ZGFX segment structure without compressionwrap_compressed(): Wraps pre-compressed data with the COMPRESSED flag setSupports both single segments (up to 65535 bytes) and multipart segments for larger payloads per MS-RDPEGFX section 2.2.5.3.
Use Case
Enables server implementations to send EGFX PDUs in spec-compliant ZGFX format. This is the wrapping layer; compression support will follow in a separate PR.
Refs: #1067