X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FExtMsg.pm;h=f3f473ab7cb776b5cbd932f74e7e65edb36c5743;hb=refs%2Fheads%2Fmaster;hp=07e740ac6385342d66f4c5a21817cb138fe57092;hpb=22709bc68bb04f5ee548053956c88eeca42ad3b4;p=spider.git diff --git a/perl/ExtMsg.pm b/perl/ExtMsg.pm index 07e740ac..f3f473ab 100644 --- a/perl/ExtMsg.pm +++ b/perl/ExtMsg.pm @@ -72,7 +72,7 @@ sub dequeue my $conn = shift; my $msg; - if ($conn->{csort} eq 'ax25' && exists $conn->{msg}) { + if ($conn->ax25 && exists $conn->{msg}) { $conn->{msg} =~ s/\cM/\cJ/g; } if ($conn->{state} eq 'WC') { @@ -104,9 +104,9 @@ sub dequeue $msg = uc $msg; if (is_callsign($msg) && $msg !~ m|/| ) { my $sort = $conn->{csort}; - $sort = 'local' if $conn->{peerhost} eq "127.0.0.1"; + $sort = 'local' if $conn->{peerhost} =~ /127\.\d+\.\d+\.\d+$/ || $conn->{peerhost} eq '::1'; my $uref; - if ($main::passwdreq || ($uref = DXUser->get_current($msg)) && $uref->passwd ) { + if ($main::passwdreq || ($uref = DXUser::get_current($msg)) && $uref->passwd ) { $conn->conns($msg); $conn->{state} = 'WP'; $conn->{decho} = $conn->{echo}; @@ -120,13 +120,13 @@ sub dequeue $conn->disconnect; } } elsif ($conn->{state} eq 'WP' ) { - my $uref = DXUser->get_current($conn->{call}); + my $uref = DXUser::get_current($conn->{call}); $msg =~ s/[\r\n]+$//; if ($uref && $msg eq $uref->passwd) { my $sort = $conn->{csort}; $conn->{echo} = $conn->{decho}; delete $conn->{decho}; - $sort = 'local' if $conn->{peerhost} eq "127.0.0.1"; + $sort = 'local' if $conn->{peerhost} =~ /127\.\d+\.\d+\.\d+$/ || $conn->{peerhost} eq '::1'; $conn->{usedpasswd} = 1; $conn->to_connected($conn->{call}, 'A', $sort); } else { @@ -153,7 +153,11 @@ sub to_connected delete $conn->{cmd}; $conn->{timeout}->del if $conn->{timeout}; delete $conn->{timeout}; - $conn->nolinger unless $conn->isa('AGWMsg'); + $conn->{csort} = $sort; + unless ($conn->ax25) { + eval {$conn->{peerhost} = $conn->{sock}->peerhost}; + $conn->nolinger; + } &{$conn->{rproc}}($conn, "$dir$call|$sort"); $conn->_send_file("$main::data/connected") unless $conn->{outgoing}; } @@ -361,6 +365,7 @@ sub _doclient $conn->conns($call); $conn->{csort} = $f[1] if $f[1]; $conn->{state} = 'C'; + eval {$conn->{peerhost} = $conn->{sock}->peerhost} unless $conn->ax25; &{$conn->{rproc}}($conn, "O$call|$conn->{csort}"); delete $conn->{cmd}; $conn->{timeout}->del if $conn->{timeout};