=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/rsync/blocks.c,v retrieving revision 1.21 retrieving revision 1.22 diff -c -r1.21 -r1.22 *** src/usr.bin/rsync/blocks.c 2021/11/03 14:42:12 1.21 --- src/usr.bin/rsync/blocks.c 2024/02/27 11:28:30 1.22 *************** *** 1,4 **** ! /* $OpenBSD: blocks.c,v 1.21 2021/11/03 14:42:12 deraadt Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons * --- 1,4 ---- ! /* $OpenBSD: blocks.c,v 1.22 2024/02/27 11:28:30 claudio Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons * *************** *** 280,285 **** --- 280,287 ---- blk->len, blk->idx); tok = -(blk->idx + 1); + hash_file_buf(&st->ctx, st->map + last, sz + blk->len); + /* * Write the data we have, then follow it with * the tag of the block that matches. *************** *** 293,298 **** --- 295,301 ---- st->total += blk->len; st->offs += blk->len; st->hint = blk->idx + 1; + return; } *************** *** 308,319 **** --- 311,326 ---- st->curlen = st->curpos + sz; st->curtok = 0; st->curst = sz ? BLKSTAT_DATA : BLKSTAT_TOK; + + hash_file_buf(&st->ctx, st->map + st->curpos, sz); } else { st->curpos = 0; st->curlen = st->mapsz; st->curtok = 0; st->curst = st->mapsz ? BLKSTAT_DATA : BLKSTAT_TOK; st->dirty = st->total = st->mapsz; + + hash_file_buf(&st->ctx, st->map, st->mapsz); LOG4("%s: flushing whole file %zu B", path, st->mapsz);