projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix set/badip so that it appends to the existing file
[spider.git]
/
cmd
/
show
/
wm7d.pl
diff --git
a/cmd/show/wm7d.pl
b/cmd/show/wm7d.pl
index 068097cac1a47f9ff92851ae845a2ecf2b84ed90..0aa7e9918084c6e32ace0d25f50d41f9e982d712 100644
(file)
--- a/
cmd/show/wm7d.pl
+++ b/
cmd/show/wm7d.pl
@@
-1,7
+1,7
@@
#
# Query the WM7D Database server for a callsign
#
#
# Query the WM7D Database server for a callsign
#
-# Was Largely based on "sh/qrz"
and info in the Net::Telnet documentation
+# Was Largely based on "sh/qrz"
#
# Original Copyright (c) 2002 Charlie Carroll K1XX
#
#
# Original Copyright (c) 2002 Charlie Carroll K1XX
#
@@
-17,7
+17,10
@@
sub waitfor
my $buf = $conn->{msg};
$buf =~ s/\r/\\r/g;
$buf =~ s/\n/\\n/g;
my $buf = $conn->{msg};
$buf =~ s/\r/\\r/g;
$buf =~ s/\n/\\n/g;
- dbg "state $conn->{state} '$msg' '$buf'";
+
+ dbg "state $conn->{state} '$msg' '$buf'" if isdbg('wm7d');
+
+ $conn->{_wm7d} ||= [];
if ($conn->{state} eq 'waitfor') {
if ($msg =~ /utc$/ ) {
if ($conn->{state} eq 'waitfor') {
if ($msg =~ /utc$/ ) {
@@
-30,13
+33,23
@@
sub waitfor
$conn->{state} = 'ending';
}
return if $msg =~ /^query->/;
$conn->{state} = 'ending';
}
return if $msg =~ /^query->/;
-
$conn->handle_raw($msg)
;
+
push @{$conn->{_wm7d}}, $msg
;
} else {
return if $msg =~ /^query->/ || $msg =~ /bye/;
} else {
return if $msg =~ /^query->/ || $msg =~ /bye/;
- $conn->handle_raw($msg);
+# $conn->handle_raw($msg);
+ push @{$conn->{_wm7d}}, $msg;
}
}
}
}
+sub on_disc
+{
+ my $conn = shift;
+ my $dxchan = shift;
+# $DB::single = 1;
+
+ $dxchan->send(map {"$conn->{prefix}$_"} @{$conn->{_wm7d}});
+}
+
# wm7d accepts only single callsign
sub handle
{
# wm7d accepts only single callsign
sub handle
{
@@
-58,7
+71,7
@@
sub handle
Log('call', "$call: show/wm7d \U$line");
my $conn = AsyncMsg->raw($self, $target, $port,
Log('call', "$call: show/wm7d \U$line");
my $conn = AsyncMsg->raw($self, $target, $port,
- handler => \&waitfor, prefix=>'wm7d> ');
+ handler => \&waitfor, prefix=>'wm7d> '
, on_disc =>\&on_disc
);
if ($conn) {
$conn->{state} = 'waitfor';
$conn->{target_call} = $line;
if ($conn) {
$conn->{state} = 'waitfor';
$conn->{target_call} = $line;