pub fn compress_message(msg: &[u8], algorithm: u16) -> Option<Vec<u8>>Expand description
Wrap msg in an unchained LZNT1 COMPRESSION_TRANSFORM. Returns None when
the algorithm is unsupported or compression does not shrink the message (the
caller then sends it uncompressed).
For a READ response only the file data is compressed, leaving the SMB2 header and READ response structure uncompressed via the transform Offset field. This mirrors Windows and, per [MS-SMB2] ยง3.1.4.4 step 5/6, avoids emitting a transform when compression would not shrink the payload (e.g. a tiny or incompressible read).