I noticed that although prototab.c defines a heap of single byte literal commands we are never using them, instead always using RS_OP_LITERAL_N1 instead, which uses 2 bytes. This means small litterals with 64 or less bytes are using a 2 byte command instead of a single byte command.
We are both not emitting single byte literal commands, and also not correctly interpreting them. This means adding support for this will produce deltas that are not backwards compatible with older rdiff versions. Unfortunately the current handling of this will try to interpret the following literal data as an integer length of literal data, producing at best a logged error message and assert failure (asserts are disabled in release builds) before proceeding with corrupt data, maybe halting with RS_CORRUPT later, but possibly completing with corrupt results.
So adding support for this may require a bump in the delta magic to warn about this.
The text was updated successfully, but these errors were encountered:
Actually, looking at the code a bit closer, I think we are correctly interpreting single-byte literal commands in patch.c, which means bumping the delta magic will not be required, and deltas that use them should work fine with older versions of librsync.
I noticed that although prototab.c defines a heap of single byte literal commands we are never using them, instead always using RS_OP_LITERAL_N1 instead, which uses 2 bytes. This means small litterals with 64 or less bytes are using a 2 byte command instead of a single byte command.
We are both not emitting single byte literal commands, and also not correctly interpreting them. This means adding support for this will produce deltas that are not backwards compatible with older rdiff versions. Unfortunately the current handling of this will try to interpret the following literal data as an integer length of literal data, producing at best a logged error message and assert failure (asserts are disabled in release builds) before proceeding with corrupt data, maybe halting with RS_CORRUPT later, but possibly completing with corrupt results.
So adding support for this may require a bump in the delta magic to warn about this.
The text was updated successfully, but these errors were encountered: