zstd
zstd copied to clipboard
Add Controls to Constrain Window Size to Protocol Limits
This PR adds convenience options that ensure Zstd produces compressed outputs compatible with protocols that place limits on the window size. Currently, it supports two protocols:
- The
zstdHTTP Content-Encoding (RFC 8878 and RFC 9659). - The
dczHTTP Content-Encoding (draft-ietf-httpbis-compression-dictionary-19).
This option is exposed as a new CCtx param ZSTD_c_constrainWindowForProtocol and a corresponding CLI argument --constrain-window.
To-Do:
- [x] Add CCtx Param.
- [x] Add CLI Flags.
- [x] Add tests.
cc @pmeenan, @nidhijaju. We'd talked about this being desirable for adoption of dcz. Take a look and make sure it meets your needs? It should go out in the next Zstd release which is coming very soon.