- #
- # position the file at the start of the rsync block checksums
- # (4 (adler) + 16 (md4) bytes each)
- #
- return -8
- if ( !defined(seek($fh, -$dg->{nBlocks}*20 - 48, 2)) );
+ if ( length($data) >= $dg->{nBlocks} * 20 + 48 ) {
+ #
+ # We have all the data already - just remember it
+ #
+ $dg->{digestData} = substr($data,
+ length($data) - $dg->{nBlocks} * 20 - 48,
+ $dg->{nBlocks} * 20);
+ } else {
+ #
+ # position the file at the start of the rsync block checksums
+ # (4 (adler) + 16 (md4) bytes each)
+ #
+ return -8
+ if ( !defined(sysseek($fh, -$dg->{nBlocks} * 20 - 48, 2)) );
+ }