X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2Fclient.pl;h=db3bb80a1b720be88880cd3b5323c0d2e1e5410d;hb=295f32fa75fefedcf1cd980c5afcc5de08417ba9;hp=459c26323a34480131247918043d9124649962dd;hpb=ce2e3045bad021ba833c91dcc45b779a57752960;p=spider.git diff --git a/perl/client.pl b/perl/client.pl index 459c2632..db3bb80a 100755 --- a/perl/client.pl +++ b/perl/client.pl @@ -41,6 +41,7 @@ BEGIN { use Msg; use DXVars; use DXDebug; +use DXUtil; use Net::Telnet qw(TELOPT_ECHO); use IO::File; use IO::Socket; @@ -53,6 +54,7 @@ sub cease my $sendz = shift; if ($conn && $sendz) { $conn->send_now("Z$call|bye...\n"); + sleep(1); } $stdout->flush if $stdout; if ($pid) { @@ -62,6 +64,9 @@ sub cease dbgclose(); # $SIG{__WARN__} = sub {my $a = shift; cluck($a); }; sleep(1); + + # do we need this ? + $conn->disconnect if $conn; exit(0); } @@ -374,42 +379,22 @@ if ($loginreq) { $stdout->print($issue) if $issue; } - - use DXUser; - - DXUser->init($userfn); - # allow a login from an existing user. I could create a user but # I want to check for valid callsigns and I don't have the # necessary info / regular expression yet - for ($state = 0; $state < 2; ) { - alarm($timeout); + alarm($timeout); - if ($state == 0) { - $stdout->print('login: '); - $stdout->flush(); - local $\ = $nl; - $s = $stdin->getline(); - chomp $s; - $s =~ s/\s+//og; - $s =~ s/-\d+$//o; # no ssids! - cease(0) unless $s gt ' '; - $call = uc $s; - $user = DXUser->get($call); - $state = 1; - } elsif ($state == 1) { - $stdout->print('password: '); - $stdout->flush(); - local $\ = $nl; - $s = $stdin->getline(); - chomp $s; - $state = 2; - if (!$user || ($user->passwd && $user->passwd ne $s)) { - $stdout->print("sorry...$nl"); - cease(0); - } - } - } + $stdout->print('login: '); + $stdout->flush(); + local $\ = $nl; + $s = $stdin->getline(); + chomp $s; + $s =~ s/\s+//og; + $s =~ s/-\d+$//o; # no ssids! + cease(0) unless $s gt ' ' && iscallsign($s); + $call = uc $s; + $connsort = 'telnet' if $connsort eq 'local'; + alarm(0); } # handle callsign and connection type firtling