projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
pass the correct line to PCProt
[spider.git]
/
perl
/
AGWMsg.pm
diff --git
a/perl/AGWMsg.pm
b/perl/AGWMsg.pm
index 693f31085235cc6105301d403251e7fbceffe76f..f6fc50747f9a5fa005099630777770e4cdec2986 100644
(file)
--- a/
perl/AGWMsg.pm
+++ b/
perl/AGWMsg.pm
@@
-30,7
+30,7
@@
use AGWConnect;
use DXDebug;
use vars qw(@ISA $sock @outqueue $send_offset $inmsg $rproc $noports $lastytime
use DXDebug;
use vars qw(@ISA $sock @outqueue $send_offset $inmsg $rproc $noports $lastytime
- $lasthtime $ypolltime $hpolltime %circuit);
+ $lasthtime $ypolltime $hpolltime %circuit
$total_in $total_out
);
@ISA = qw(Msg ExtMsg);
$sock = undef;
@ISA = qw(Msg ExtMsg);
$sock = undef;
@@
-43,6
+43,7
@@
$lastytime = $lasthtime = time;
$ypolltime = 10 unless defined $ypolltime;
$hpolltime = 300 unless defined $hpolltime;
%circuit = ();
$ypolltime = 10 unless defined $ypolltime;
$hpolltime = 300 unless defined $hpolltime;
%circuit = ();
+$total_in = $total_out = 0;
use vars qw($VERSION $BRANCH);
$VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ );
use vars qw($VERSION $BRANCH);
$VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ );
@@
-171,6
+172,7
@@
sub _send
if (isdbg('raw')) {
dbgdump('raw', "AGW send $bytes_written: ", $msg);
}
if (isdbg('raw')) {
dbgdump('raw', "AGW send $bytes_written: ", $msg);
}
+ $total_out += $bytes_written;
$offset += $bytes_written;
$bytes_to_write -= $bytes_written;
}
$offset += $bytes_written;
$bytes_to_write -= $bytes_written;
}
@@
-196,6
+198,7
@@
sub _rcv { # Complement to _send
$bytes_read = sysread ($sock, $msg, 1024, 0);
if (defined ($bytes_read)) {
if ($bytes_read > 0) {
$bytes_read = sysread ($sock, $msg, 1024, 0);
if (defined ($bytes_read)) {
if ($bytes_read > 0) {
+ $total_in += $bytes_read;
$inmsg .= $msg;
if (isdbg('raw')) {
dbgdump('raw', "AGW read $bytes_read: ", $msg);
$inmsg .= $msg;
if (isdbg('raw')) {
dbgdump('raw', "AGW read $bytes_read: ", $msg);
@@
-324,15
+327,9
@@
sub _decode
$conn->{incoming} = 1;
$conn->{agwcall} = $call;
$circuit{$call} = $conn;
$conn->{incoming} = 1;
$conn->{agwcall} = $call;
$circuit{$call} = $conn;
- if ($call =~ /^(\w+)-(\d\d?)$/) {
- my $c = $1;
- my $s = $2;
- $s = 15 - $s;
- if ($s <= 8 && $s > 0) {
- $call = "${c}-${s}";
- } else {
- $call = $c;
- }
+ if (my ($c, $s) = $call =~ /^(\w+)-(\d\d?)$/) {
+ $s = 15 - $s if $s > 8;
+ $call = $s > 0 ? "${c}-${s}" : $c;
}
$conn->to_connected($call, 'A', $conn->{csort} = 'ax25');
}
}
$conn->to_connected($call, 'A', $conn->{csort} = 'ax25');
}