From: minima Date: Tue, 8 Jan 2002 11:18:11 +0000 (+0000) Subject: modified sh/qrz a bit to cope with slow server X-Git-Tag: R_1_50~109 X-Git-Url: http://www.dxcluster.org/gitweb/gitweb.cgi?p=spider.git;a=commitdiff_plain;h=9bafb5297d126d00203d67addaa918c0f056d9a8 modified sh/qrz a bit to cope with slow server make 's' -> send not save --- diff --git a/TODO b/TODO index ebcf58a9..1a5b9021 100644 --- a/TODO +++ b/TODO @@ -10,6 +10,10 @@ Maintenance and Enhancements * sh/maxusers (max users in node since last restart) * review badwords * fix non-english apropos to only show english when there REALLY is nothing else +* cmd for callbook server ab6qv.qnet.com 1235 (non-us calls only) +* write a parallel event driven system for helper routines +* handle distros in announces +* check set/homenode et al input for proper callsigns New Protocol Stuff ------------------ diff --git a/cmd/Aliases b/cmd/Aliases index 2bedd5dc..d2a3c93e 100644 --- a/cmd/Aliases +++ b/cmd/Aliases @@ -99,6 +99,7 @@ package CmdAlias; '^rcmd/(\S+)', 'rcmd $1', 'rcmd', ], 's' => [ + '^s$', 'send', 'send', '^s/p$', 'send', 'send', '^sb$', 'send noprivate', 'send', '^set/home$', 'set/homenode', 'set/homenode', diff --git a/cmd/show/qrz.pl b/cmd/show/qrz.pl index 0d6e2d48..7665f08c 100644 --- a/cmd/show/qrz.pl +++ b/cmd/show/qrz.pl @@ -23,17 +23,26 @@ use Net::Telnet; my $t = new Net::Telnet; foreach $l (@list) { - $t->open(Host => $target, - Port => $port, - Timeout => 15); - if ($t) { + eval { + $t->open(Host => $target, + Port => $port, + Timeout => 15); + }; + + if (!$t || $@) { + push @out, $self->msg('e18', 'QRZ.com'); + } else { my $s = "GET $url/dxcluster.cgi?callsign=$l\&uid=$Internet::qrz_uid\&pw=$Internet::qrz_pw HTTP/1.0\n\n"; # print $s; $t->print($s); Log('call', "$call: show/qrz \U$l"); my $state = "blank"; - while (my $result = $t->getline) { - dbg($result) if isdbg('qrz'); + while (my $result = eval { $t->getline(Timeout => 30) } || $@) { + dbg($result) if isdbg('qrz') && $result; + if ($@) { + push @out, $self->msg('e18', 'QRZ.com'); + last; + } if ($state eq 'blank' && $result =~ /^\s*Callsign\s*:/i) { $state = 'go'; } elsif ($state eq 'go') { @@ -44,8 +53,6 @@ foreach $l (@list) { } $t->close; push @out, $self->msg('e3', 'qrz.com', uc $l) unless @out; - } else { - push @out, $self->msg('e18', 'QRZ.com'); } }