* Read message digest of bfd, updating digest
* In case of errors we need the job control record and file name.
*/
-int read_digest(BFILE *bfd, DIGEST *digest, JCR *jcr)
+static int read_digest(BFILE *bfd, DIGEST *digest, JCR *jcr)
{
char buf[DEFAULT_NETWORK_BUFFER_SIZE];
int64_t n;
+ int64_t bufsiz = (int64_t)sizeof(buf);
+ FF_PKT *ff_pkt = (FF_PKT *)jcr->ff;
+ uint64_t fileAddr = 0; /* file address */
+
Dmsg0(50, "=== read_digest\n");
- while ((n=bread(bfd, buf, sizeof(buf))) > 0) {
+ while ((n=bread(bfd, buf, bufsiz)) > 0) {
+ /* Check for sparse blocks */
+ if (ff_pkt->flags & FO_SPARSE) {
+ bool haveBlock = true;
+ if (n == bufsiz &&
+ fileAddr+n < (uint64_t)ff_pkt->statp.st_size ||
+ ((ff_pkt->type == FT_RAW || ff_pkt->type == FT_FIFO) &&
+ (uint64_t)ff_pkt->statp.st_size == 0)) {
+ haveBlock = !is_buf_zero(buf, bufsiz);
+ }
+ fileAddr += n; /* update file address */
+ if (!haveBlock) {
+ continue; /* skip block of zeros */
+ }
+ }
+
crypto_digest_update(digest, (uint8_t *)buf, n);
jcr->JobBytes += n;
jcr->ReadBytes += n;
General:
09Sep08
+kes Enable Win32 plugin load code in lib.
+kes Make Verify code that computes disk checksums use the same
+ algorithm as backup when dealing with sparse files.
+kes Attempt to run VSS on any systems newer than Vista -- should
+ make it work on Windows Server 2008.
ebl Change the new statistic implementation. Remove the UseStatistic
- directive and add a "update stats [days=...]" command. You can
+ directive and add a 'update stats [days=...]' command. You can
now decide when copy job records from Job table to JobStat.
Statistics are much more accurate with this.
08Sep08
kes Add dbuser to DIR conf file (replaces user).
kes Add --with-db-password to ./configure
kes Fix regress to handle db_password.
-ebl Add new "status storage slots" that list autochanger
+ebl Add new 'status storage slots' that list autochanger
content.
ebl Update vtape driver to compile only under Linux.
ebl Fix a bug when restoring with a wrong mediatype.