X-Git-Url: http://www.dxcluster.org/gitweb/gitweb.cgi?p=spider.git;a=blobdiff_plain;f=perl%2FDXChannel.pm;h=b661510040eebe5954bf7063b24169a2a435fa5c;hp=6a867bb95185896d9c726ba4e15c3e99577a6b01;hb=f77b59f4fcceb428142461972e94345419cbda28;hpb=60c0ea1747bc8ad95e531d29025f7bcee4fd10c1 diff --git a/perl/DXChannel.pm b/perl/DXChannel.pm index 6a867bb9..b6615100 100644 --- a/perl/DXChannel.pm +++ b/perl/DXChannel.pm @@ -11,6 +11,7 @@ require Exporter; @ISA = qw(Exporter); use Msg; +use DXUtil; %connects = undef; @@ -20,7 +21,7 @@ sub new my ($pkg, $call, $conn, $user) = @_; my $self = {}; - die "trying to create a duplicate Connect for call $call\n" if $connects{$call}; + die "trying to create a duplicate channel for $call" if $connects{$call}; $self->{call} = $call; $self->{conn} = $conn; $self->{user} = $user; @@ -74,7 +75,9 @@ sub send_now my $line; foreach $line (@_) { - print DEBUG "$t > $sort $call $line\n" if defined DEBUG; + my $t = atime; + chomp $line; + print main::DEBUG "$t > $sort $call $line\n" if defined DEBUG; print "> $sort $call $line\n"; $conn->send_now("$sort$call|$line"); } @@ -89,7 +92,9 @@ sub send_later my $line; foreach $line (@_) { - print DEBUG "$t > $sort $call $line\n" if defined DEBUG; + my $t = atime; + chomp $line; + print main::DEBUG "$t > $sort $call $line\n" if defined DEBUG; print "> $sort $call $line\n"; $conn->send_later("$sort$call|$line"); }