]> dxcluster.org Git - spider.git/commitdiff
allow ^Z in messages again
authorminima <minima>
Thu, 22 Mar 2001 15:25:09 +0000 (15:25 +0000)
committerminima <minima>
Thu, 22 Mar 2001 15:25:09 +0000 (15:25 +0000)
Changes
perl/ExtMsg.pm
perl/IntMsg.pm
perl/Msg.pm

diff --git a/Changes b/Changes
index 206e7f07b14b1a2b7a7ee2db04ea4321893a9ef1..2f81542db516afd3b783ac4940adc8bb8f66faf9 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,6 @@
 22Mar01=======================================================================
 1. edit the helpfile for set/debug and add help for show/debug
+2. Allow ^Z again on messages
 19Mar01=======================================================================
 1. Add 'not allowed' messages into sh/filter with callsign and reduce priv
 2. decode %xx characters in winclient.pl
index b39637d10e2af6f243eb580a6cbd814041ff24a1..9b4bb061a0bf2dc637c45020c8823db2a8ac0932 100644 (file)
@@ -19,7 +19,7 @@ use DXUtil;
 use DXDebug;
 use IO::File;
 use IO::Socket;
-use IPC::Open2;
+use IPC::Open3;
 
 use vars qw(@ISA $deftimeout);
 
@@ -83,7 +83,7 @@ sub dequeue
                        dbg('connect', $msg) unless $conn->{state} eq 'C';
                
                        $msg =~ s/\xff\xfa.*\xff\xf0|\xff[\xf0-\xfe].//g; # remove telnet options
-                       $msg =~ s/[\x00-\x08\x0a-\x1f\x80-\x9f]/./g;         # immutable CSI sequence + control characters
+                       $msg =~ s/[\x00-\x08\x0a-\x19\x1b-\x1f\x80-\x9f]/./g;         # immutable CSI sequence + control characters
                        
                        if ($conn->{state} eq 'C') {
                                &{$conn->{rproc}}($conn, "I$conn->{call}|$msg");
@@ -211,17 +211,15 @@ sub _doconnect
                        dbg('connect', "***Connect Failed to $host $port $!");
                }
        } elsif ($sort eq 'ax25' || $sort eq 'prog') {
-               $conn->{sock} = new IO::File;
-               if ($conn->{sock}) {
-                       my $outfd = fileno($conn->{sock});
-                       my $out = new IO::File ">&$outfd";
-                       if ($conn->{pid} = open2($conn->{sock}, $out, $line)) {
-                               $conn->{csort} = $sort;
-                               $conn->{lineend} = "\cM" if $sort eq 'ax25';
-                               dbg('connect', "started $line");
-                       } else {
-                               dbg('connect', "can't start $line $!");
-                       }
+               my $sock = new IO::Socket::INET;
+               local *H;
+               my $wrt = \*H;
+               
+               if ($conn->{pid} = open3("<&$sock", ">&$sock", '', $line)) {
+                       $conn->{sock} = $sock;
+                       $conn->{csort} = $sort;
+                       $conn->{lineend} = "\cM" if $sort eq 'ax25';
+                       dbg('connect', "started pid: $conn->{pid} as $line");
                } else {
                        dbg('connect', "can't start $line $!");
                }
index 8065f3024e5c693e04e7b50620a5d136e83c2a00..6e588b3ef7ddbb86c0165e229d37181c08179253 100644 (file)
@@ -37,7 +37,7 @@ sub dequeue
                for (@lines) {
                        if (defined $_) {
                                s/\%([0-9A-F][0-9A-F])/chr(hex($1))/eg;
-                               s/[\x00-\x08\x0a-\x1f\x80-\x9f]/./g;         # immutable CSI sequence + control characters
+                               s/[\x00-\x08\x0a-\x19\x1b-\x1f\x80-\x9f]/./g;         # immutable CSI sequence + control characters
                        } else {
                                $_ = '';
                        }
index f925681841c0746e44b7e7ee0d65b31d11a9c20c..ec07d61da6878851f6b8f11f19aba403e5729cbd 100644 (file)
@@ -283,6 +283,22 @@ sub _send {
     1;  # Success
 }
 
+sub dup_sock
+{
+       my $conn = shift;
+       my $oldsock = $conn->{sock};
+       my $rc = $rd_callbacks{$oldsock};
+       my $wc = $wt_callbacks{$oldsock};
+       my $ec = $er_callbacks{$oldsock};
+       my $sock = $oldsock->new_from_fd($oldsock, "w+");
+       if ($sock) {
+               set_event_handler($oldsock, read=>undef, write=>undef, error=>undef);
+               $conn->{sock} = $sock;
+               set_event_handler($sock, read=>$rc, write=>$wc, error=>$ec);
+               $oldsock->close;
+       }
+}
+
 sub _err_will_block {
        return 0 unless $blocking_supported;
        return ($_[0] == $eagain || $_[0] == $ewouldblock || $_[0] == $einprogress);