TEST_MDFOUR is defined: it did not have the fix that the main
rsync code got back in protocol 27 to properly handle files
that are a multiple of 64-bytes long.
+int protocol_version = 28;
+
static void file_checksum1(char *fname)
{
static void file_checksum1(char *fname)
{
+ int fd, i, was_multiple_of_64 = 1;
struct mdfour md;
unsigned char buf[64*1024], sum[16];
struct mdfour md;
unsigned char buf[64*1024], sum[16];
while (1) {
int n = read(fd, buf, sizeof(buf));
while (1) {
int n = read(fd, buf, sizeof(buf));
+ if (n <= 0)
+ break;
+ was_multiple_of_64 = !(n % 64);
mdfour_update(&md, buf, n);
}
mdfour_update(&md, buf, n);
}
+ if (was_multiple_of_64 && protocol_version >= 27)
+ mdfour_update(&md, buf, 0);