From: minima Date: Sun, 5 Jan 2003 10:55:17 +0000 (+0000) Subject: fix some errors in sh/c X-Git-Tag: PRE-1-52~99 X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=commitdiff_plain;h=1256794cae0d863c829011df3f87dc1fb70f977d;p=spider.git fix some errors in sh/c --- diff --git a/cmd/show/configuration.pl b/cmd/show/configuration.pl index a49ffeec..cb9f1946 100644 --- a/cmd/show/configuration.pl +++ b/cmd/show/configuration.pl @@ -21,24 +21,27 @@ if ($list[0] && $list[0] =~ /^NOD/) { foreach $dxchan (@ch) { @val = sort {$a->call cmp $b->call} grep { $_->dxchan == $dxchan } @nodes; - my $call = $dxchan->call; - $call = "($call)" if $dxchan->here == 0; @l = (); + my $call = $dxchan->call; + $call ||= '???'; + $call = "($call)" unless $dxchan->here; push @l, $call; my $i = 0; - foreach $call (@val) { + foreach my $ref (@val) { if ($i >= 5) { push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l; @l = (); push @l, ""; $i = 0; } - my $s = $call->call; - $s = sprintf "(%s)", $s unless $call->here; + my $s = $ref->call; + $s ||= '???'; + $s = sprintf "(%s)", $s unless $ref->here; push @l, $s; $i++; } + push @l, "" while ($i++ < 5); push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l; } } else { @@ -46,8 +49,9 @@ if ($list[0] && $list[0] =~ /^NOD/) { foreach $node (@nodes) { next if scalar @list && !grep $node->call =~ /^$_/, @list; my $call = $node->call; - $call = "($call)" unless $node->here; @l = (); + $call ||= '???'; + $call = "($call)" unless $node->here; push @l, $call; @val = sort $node->users; @@ -72,6 +76,7 @@ if ($list[0] && $list[0] =~ /^NOD/) { push @l, $s; $i++; } + push @l, "" while ($i++ < 5); push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l; } } diff --git a/perl/DXChannel.pm b/perl/DXChannel.pm index 372599af..aae692ef 100644 --- a/perl/DXChannel.pm +++ b/perl/DXChannel.pm @@ -112,6 +112,7 @@ $count = 0; prompt => '0,Required Prompt', version => '1,Node Version', build => '1,Node Build', + verified => '9,Verified?,yesno', ); use vars qw($VERSION $BRANCH); diff --git a/perl/DXProt.pm b/perl/DXProt.pm index 330e7a60..60b0f1e6 100644 --- a/perl/DXProt.pm +++ b/perl/DXProt.pm @@ -1706,7 +1706,7 @@ sub load_hops return $self->msg('lh1') unless -e "$main::data/hop_table.pl"; do "$main::data/hop_table.pl"; return $@ if $@; - return 0; + return (); } diff --git a/perl/QXProt.pm b/perl/QXProt.pm index 82cb2075..b9cf952c 100644 --- a/perl/QXProt.pm +++ b/perl/QXProt.pm @@ -154,10 +154,15 @@ sub handleI my $self = shift; my @f = split /\^/, $_[3]; - my $inv = Verify->new($f[7]); - unless ($inv->verify($f[8], $main::me->user->passphrase, $main::mycall, $self->call)) { - $self->sendnow('D','Sorry...'); - $self->disconnect; + if ($self->passphrase && $f[7] && $f[8]) { + my $inv = Verify->new($f[7]); + unless ($inv->verify($f[8], $main::me->user->passphrase, $main::mycall, $self->call)) { + $self->sendnow('D','Sorry...'); + $self->disconnect; + } + $self->{verified} = 1; + } else { + $self->{verified} = 0; } if ($self->{outbound}) { $self->send($self->genI); @@ -175,8 +180,12 @@ sub handleI sub genI { my $self = shift; - my $inp = Verify->new; - return frame('I', $self->call, "DXSpider", ($main::version + 53) * 100, $main::build, $inp->challenge, $inp->response($self->user->passphrase, $self->call, $main::mycall)); + my @out = ('I', $self->call, "DXSpider", ($main::version + 53) * 100, $main::build); + if (my $pass = $self->user->passphrase) { + my $inp = Verify->new; + push @out, $inp->challenge, $inp->response($pass, $self->call, $main::mycall); + } + return frame(@out); } sub handleR