X-Git-Url: http://git.rot13.org/?p=BackupPC.git;a=blobdiff_plain;f=lib%2FBackupPC%2FXfer%2FRsyncFileIO.pm;h=6a1460cf6e167259c1ef2e69e8ae16ba83413d7a;hp=1c89ab915ad44c86678d202ef7eb4c38e8c3b784;hb=e4bf7ab080e172b74b3d64c196a72d0ff5d315c5;hpb=df717077755b9331fa245f72933ef03add7a3710 diff --git a/lib/BackupPC/Xfer/RsyncFileIO.pm b/lib/BackupPC/Xfer/RsyncFileIO.pm index 1c89ab9..6a1460c 100644 --- a/lib/BackupPC/Xfer/RsyncFileIO.pm +++ b/lib/BackupPC/Xfer/RsyncFileIO.pm @@ -12,7 +12,7 @@ # #======================================================================== # -# Version 3.0.0beta1, released 30 Jul 2006. +# Version 3.0.0beta2, released 11 Nov 2006. # # See http://backuppc.sourceforge.net. # @@ -160,7 +160,8 @@ sub csumStart my($err, $d, $blkSize) = BackupPC::Xfer::RsyncDigest->digestStart( $attr->{fullPath}, $attr->{size}, 0, $defBlkSize, $fio->{checksumSeed}, - 0, $attr->{compress}, 0); + 0, $attr->{compress}, 0, + $fio->{protocol_version}); my($isCached, $isInvalid) = $d->isCached; if ( $fio->{logLevel} >= 5 ) { $fio->log("$attr->{fullPath} verify; cached = $isCached," @@ -169,7 +170,8 @@ sub csumStart if ( $isCached || $isInvalid ) { my $ret = BackupPC::Xfer::RsyncDigest->digestAdd( $attr->{fullPath}, $blkSize, - $fio->{checksumSeed}, 1 # verify + $fio->{checksumSeed}, 1, # verify + $fio->{protocol_version} ); if ( $ret != 1 ) { $fio->log("Bad cached digest for $attr->{fullPath} ($ret);" @@ -185,18 +187,18 @@ sub csumStart (my $err, $fio->{csum}, my $blkSize) = BackupPC::Xfer::RsyncDigest->digestStart($attr->{fullPath}, $attr->{size}, 0, $defBlkSize, $fio->{checksumSeed}, - $needMD4, $attr->{compress}, 1); - if ( $fio->{logLevel} >= 5 ) { - my($isCached, $invalid) = $fio->{csum}->isCached; - $fio->log("$attr->{fullPath} cache = $isCached," - . " invalid = $invalid, phase = $phase"); - } + $needMD4, $attr->{compress}, 1, $fio->{protocol_version}); if ( $err ) { $fio->log("Can't get rsync digests from $attr->{fullPath}" . " (err=$err, name=$f->{name})"); $fio->{stats}{errorCnt}++; return -1; } + if ( $fio->{logLevel} >= 5 ) { + my($isCached, $invalid) = $fio->{csum}->isCached; + $fio->log("$attr->{fullPath} cache = $isCached," + . " invalid = $invalid, phase = $phase"); + } return $blkSize; } @@ -321,12 +323,14 @@ sub viewCacheDir sub attribGetWhere { - my($fio, $f, $noCache) = @_; - my($dir, $fname, $share, $shareM, $partial, $attr); + my($fio, $f, $noCache, $fname) = @_; + my($dir, $share, $shareM, $partial, $attr); - $fname = $f->{name}; - $fname = "$fio->{xfer}{pathHdrSrc}/$fname" + if ( !defined($fname) ) { + $fname = $f->{name}; + $fname = "$fio->{xfer}{pathHdrSrc}/$fname" if ( defined($fio->{xfer}{pathHdrSrc}) ); + } $fname =~ s{//+}{/}g; if ( $fname =~ m{(.*)/(.*)}s ) { $shareM = $fio->{shareM}; @@ -386,15 +390,10 @@ sub attribGet return $attr; } $target = "/$target" if ( $target !~ /^\// ); - $fio->log("$attr->{fullPath}: redirecting to $target (will trim " - . "$fio->{xfer}{pathHdrSrc})") if ( $fio->{logLevel} >= 4 ); - $target =~ s/^\Q$fio->{xfer}{pathHdrSrc}//; + $fio->log("$attr->{fullPath}: redirecting to $target") + if ( $fio->{logLevel} >= 4 ); $target =~ s{^/+}{}; - # - # Note: overwrites name to point to real file - # - $f->{name} = $target; - ($attr) = $fio->attribGetWhere($f, 1); + ($attr) = $fio->attribGetWhere($f, 1, $target); $fio->log(" ... now got $attr->{fullPath}") if ( $fio->{logLevel} >= 4 ); } @@ -1106,7 +1105,8 @@ sub fileDeltaRxDone = BackupPC::Xfer::RsyncDigest->digestStart( $attr->{fullPath}, $attr->{size}, 0, 2048, $fio->{checksumSeed}, 1, - $attr->{compress}, 1); + $attr->{compress}, 1, + $fio->{protocol_version}); if ( $err ) { $fio->log("Can't open $attr->{fullPath} for MD4" . " check (err=$err, $name)");