remove $id$ strings from BPQ changes
[spider.git] / perl / ExtMsg.pm
index f1472789152fbfc3836142577d8831e86a4b591e..07e740ac6385342d66f4c5a21817cb138fe57092 100644 (file)
@@ -5,10 +5,12 @@
 # This is where the cluster handles direct connections coming both in
 # and out
 #
-# $Id$
 #
 # 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;
 
@@ -21,17 +23,16 @@ use IO::File;
 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);
 $deftimeout = 60;
 
+sub login
+{
+       goto &main::login;        # save some writing, this was the default
+}
+
 sub enqueue
 {
        my ($conn, $msg) = @_;
@@ -152,7 +153,7 @@ sub to_connected
        delete $conn->{cmd};
        $conn->{timeout}->del if $conn->{timeout};
        delete $conn->{timeout};
-       $conn->nolinger;
+       $conn->nolinger unless $conn->isa('AGWMsg');
        &{$conn->{rproc}}($conn, "$dir$call|$sort");
        $conn->_send_file("$main::data/connected") unless $conn->{outgoing};
 }
@@ -271,6 +272,10 @@ sub _doconnect
                # 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 {
@@ -319,7 +324,7 @@ sub _dochat
        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};