#
#========================================================================
#
-# Version 3.1.0beta0, released 3 Sep 2007.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
use strict;
use Encode qw/from_to encode/;
-
-sub new
-{
- my($class, $bpc, $args) = @_;
-
- $args ||= {};
- my $t = bless {
- bpc => $bpc,
- conf => { $bpc->Conf },
- host => "",
- hostIP => "",
- shareName => "",
- pipeRH => undef,
- pipeWH => undef,
- badFiles => [],
- %$args,
- }, $class;
-
- return $t;
-}
-
-sub args
-{
- my($t, $args) = @_;
-
- foreach my $arg ( keys(%$args) ) {
- $t->{$arg} = $args->{$arg};
- }
-}
+use base qw(BackupPC::Xfer::Protocol);
sub useTar
{
return 1;
}
-sub abort
-{
- my($t, $reason) = @_;
- my @xferPid = $t->xferPid;
-
- $t->{abort} = 1;
- $t->{abortReason} = $reason;
- if ( @xferPid ) {
- kill($t->{bpc}->sigName2num("INT"), @xferPid);
- }
-}
-
sub setSelectMask
{
my($t, $FDreadRef) = @_;
vec($$FDreadRef, fileno($t->{pipeTar}), 1) = 1;
}
-sub errStr
-{
- my($t) = @_;
-
- return $t->{_errStr};
-}
-
-sub xferPid
-{
- my($t) = @_;
-
- return ($t->{xferPid});
-}
-
-sub logMsg
-{
- my($t, $msg) = @_;
-
- push(@{$t->{_logMsg}}, $msg);
-}
-
-sub logMsgGet
-{
- my($t) = @_;
-
- return shift(@{$t->{_logMsg}});
-}
-
-#
-# Returns a hash ref giving various status information about
-# the transfer.
-#
-sub getStats
-{
- my($t) = @_;
-
- return { map { $_ => $t->{$_} }
- qw(byteCnt fileCnt xferErrCnt xferBadShareCnt xferBadFileCnt
- xferOK hostAbort hostError lastOutputLine)
- };
-}
-
-sub getBadFiles
-{
- my($t) = @_;
-
- return @{$t->{badFiles}};
-}
-
1;