projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
and also in sh/db0sdx.pl
[spider.git]
/
perl
/
ExtMsg.pm
diff --git
a/perl/ExtMsg.pm
b/perl/ExtMsg.pm
index 133a1513acdef46cba5bb2cefc808f601e104716..f3f473ab7cb776b5cbd932f74e7e65edb36c5743 100644
(file)
--- a/
perl/ExtMsg.pm
+++ b/
perl/ExtMsg.pm
@@
-5,10
+5,12
@@
# This is where the cluster handles direct connections coming both in
# and out
#
# This is where the cluster handles direct connections coming both in
# and out
#
-# $Id$
#
# Copyright (c) 2001 - Dirk Koopman G1TLH
#
#
# Copyright (c) 2001 - Dirk Koopman G1TLH
#
+# Modified Jan 2006 by John Wiseman G8BPQ to support connections to BPQ32 node,
+# and fix pattern matching on 'chat' abort handling
+#
package ExtMsg;
package ExtMsg;
@@
-21,12
+23,6
@@
use IO::File;
use IO::Socket;
use IPC::Open3;
use IO::Socket;
use IPC::Open3;
-use vars qw($VERSION $BRANCH);
-$VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ );
-$BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/ || (0,0));
-$main::build += $VERSION;
-$main::branch += $BRANCH;
-
use vars qw(@ISA $deftimeout);
@ISA = qw(Msg);
use vars qw(@ISA $deftimeout);
@ISA = qw(Msg);
@@
-76,7
+72,7
@@
sub dequeue
my $conn = shift;
my $msg;
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') {
$conn->{msg} =~ s/\cM/\cJ/g;
}
if ($conn->{state} eq 'WC') {
@@
-108,9
+104,9
@@
sub dequeue
$msg = uc $msg;
if (is_callsign($msg) && $msg !~ m|/| ) {
my $sort = $conn->{csort};
$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;
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};
$conn->conns($msg);
$conn->{state} = 'WP';
$conn->{decho} = $conn->{echo};
@@
-124,13
+120,13
@@
sub dequeue
$conn->disconnect;
}
} elsif ($conn->{state} eq 'WP' ) {
$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};
$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 {
$conn->{usedpasswd} = 1;
$conn->to_connected($conn->{call}, 'A', $sort);
} else {
@@
-157,7
+153,11
@@
sub to_connected
delete $conn->{cmd};
$conn->{timeout}->del if $conn->{timeout};
delete $conn->{timeout};
delete $conn->{cmd};
$conn->{timeout}->del if $conn->{timeout};
delete $conn->{timeout};
- $conn->nolinger;
+ $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};
}
&{$conn->{rproc}}($conn, "$dir$call|$sort");
$conn->_send_file("$main::data/connected") unless $conn->{outgoing};
}
@@
-276,6
+276,10
@@
sub _doconnect
# turn it into an AGW object
bless $conn, 'AGWMsg';
$r = $conn->connect($line);
# turn it into an AGW object
bless $conn, 'AGWMsg';
$r = $conn->connect($line);
+ } elsif ($sort eq 'bpq') {
+ # turn it into an BPQ object
+ bless $conn, 'BPQMsg';
+ $r = $conn->connect($line);
} elsif ($sort eq 'ax25' || $sort eq 'prog') {
$r = $conn->start_program($line, $sort);
} else {
} elsif ($sort eq 'ax25' || $sort eq 'prog') {
$r = $conn->start_program($line, $sort);
} else {
@@
-324,7
+328,7
@@
sub _dochat
if ($line) {
if ($expect) {
dbg("connect $conn->{cnum}: expecting: \"$expect\" received: \"$line\"") if isdbg('connect');
if ($line) {
if ($expect) {
dbg("connect $conn->{cnum}: expecting: \"$expect\" received: \"$line\"") if isdbg('connect');
- if ($conn->{abort} && $line =~ /
\Q
$conn->{abort}/i) {
+ if ($conn->{abort} && $line =~ /$conn->{abort}/i) {
dbg("connect $conn->{cnum}: aborted on /$conn->{abort}/") if isdbg('connect');
$conn->disconnect;
delete $conn->{cmd};
dbg("connect $conn->{cnum}: aborted on /$conn->{abort}/") if isdbg('connect');
$conn->disconnect;
delete $conn->{cmd};
@@
-361,6
+365,7
@@
sub _doclient
$conn->conns($call);
$conn->{csort} = $f[1] if $f[1];
$conn->{state} = 'C';
$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};
&{$conn->{rproc}}($conn, "O$call|$conn->{csort}");
delete $conn->{cmd};
$conn->{timeout}->del if $conn->{timeout};