Repository navigation
feat: implement xattr abbreviation wire format for -X/--xattrs interop - #3117
Merged
Merged
Conversation
Implement the receiver-side xattr abbreviation protocol matching upstream rsync's receive_xattr() in xattrs.c. For xattr values exceeding MAX_FULL_DATUM (32 bytes), the sender transmits only a checksum; the receiver requests full values via delta-encoded 1-based entry numbers. Key changes: - Add read_with_codec_xattr() to SenderAttrs for ITEM_REPORT_XATTR parsing - Add read_xattr_abbreviation_data() for delta-encoded (num, value) pairs - Add write_xattr_request() for generator-side abbreviation requests - Add apply_xattr_abbreviation_values() to update xattr cache with full data - Wire preserve_xattrs and want_xattr_optim through RequestConfig - Update both pipelined (streaming.rs) and non-pipelined (response.rs) paths - Respect CF_AVOID_XATTR_OPTIM flag for local-change hardlink optimization
The protocol crate's varint module is private. Use the public re-exports at the crate root (protocol::read_varint, protocol::write_varint) instead of the private module path.
oferchen
added a commit
that referenced
this pull request
May 1, 2026
#3117) * feat: implement xattr abbreviation wire format for -X/--xattrs interop Implement the receiver-side xattr abbreviation protocol matching upstream rsync's receive_xattr() in xattrs.c. For xattr values exceeding MAX_FULL_DATUM (32 bytes), the sender transmits only a checksum; the receiver requests full values via delta-encoded 1-based entry numbers. Key changes: - Add read_with_codec_xattr() to SenderAttrs for ITEM_REPORT_XATTR parsing - Add read_xattr_abbreviation_data() for delta-encoded (num, value) pairs - Add write_xattr_request() for generator-side abbreviation requests - Add apply_xattr_abbreviation_values() to update xattr cache with full data - Wire preserve_xattrs and want_xattr_optim through RequestConfig - Update both pipelined (streaming.rs) and non-pipelined (response.rs) paths - Respect CF_AVOID_XATTR_OPTIM flag for local-change hardlink optimization * fix: use public re-exports for varint functions The protocol crate's varint module is private. Use the public re-exports at the crate root (protocol::read_varint, protocol::write_varint) instead of the private module path.
oferchen
added a commit
that referenced
this pull request
May 5, 2026
#3117) * feat: implement xattr abbreviation wire format for -X/--xattrs interop Implement the receiver-side xattr abbreviation protocol matching upstream rsync's receive_xattr() in xattrs.c. For xattr values exceeding MAX_FULL_DATUM (32 bytes), the sender transmits only a checksum; the receiver requests full values via delta-encoded 1-based entry numbers. Key changes: - Add read_with_codec_xattr() to SenderAttrs for ITEM_REPORT_XATTR parsing - Add read_xattr_abbreviation_data() for delta-encoded (num, value) pairs - Add write_xattr_request() for generator-side abbreviation requests - Add apply_xattr_abbreviation_values() to update xattr cache with full data - Wire preserve_xattrs and want_xattr_optim through RequestConfig - Update both pipelined (streaming.rs) and non-pipelined (response.rs) paths - Respect CF_AVOID_XATTR_OPTIM flag for local-change hardlink optimization * fix: use public re-exports for varint functions The protocol crate's varint module is private. Use the public re-exports at the crate root (protocol::read_varint, protocol::write_varint) instead of the private module path.
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.
Summary
receive_xattr()inxattrs.cMAX_FULL_DATUM(32 bytes), sender transmits only a checksum; receiver requests full values via delta-encoded 1-based entry numbersITEM_REPORT_XATTRandITEM_LOCAL_CHANGEflag handling toSenderAttrspreserve_xattrsandwant_xattr_optimthroughRequestConfigto both pipelined and non-pipelined transfer pathsCF_AVOID_XATTR_OPTIMcompatibility flag for local-change hardlink optimizationUpstream Reference
xattrs.c:receive_xattr()- abbreviation protocolxattrs.c:send_xattr_request()/receive_xattr_request()- full value exchangersync.h:MAX_FULL_DATUM(32) - threshold for abbreviationTest plan
--xattrsto oc-rsync daemon--xattrsto upstream daemon