projects
/
spider.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2c10c7a
)
changed frames from client to be I frames to distinguish echos from telnet
author
djk
<djk>
Mon, 14 Dec 1998 13:15:33 +0000
(13:15 +0000)
committer
djk
<djk>
Mon, 14 Dec 1998 13:15:33 +0000
(13:15 +0000)
perl/client.pl
patch
|
blob
|
history
perl/cluster.pl
patch
|
blob
|
history
diff --git
a/perl/client.pl
b/perl/client.pl
index d431a0d12430a982516919eea23f9f23ac9ec10b..ce0085dedd10e1c52ee40850c51dc0cff14f18b5 100755
(executable)
--- a/
perl/client.pl
+++ b/
perl/client.pl
@@
-117,6
+117,16
@@
sub rec_socket
} elsif ($sort eq 'M') {
$mode = $line; # set new mode from cluster
setmode();
} elsif ($sort eq 'M') {
$mode = $line; # set new mode from cluster
setmode();
+ } elsif ($sort eq 'E') {
+ if ($sort eq 'telnet') {
+ $mode = $line; # set echo mode from cluster
+ my $term = POSIX::Termios->new;
+ $term->getattr(fileno($sock));
+ $term->setflag( &POSIX::ISIG );
+ $term->setattr(fileno($sock), &POSIX::TCSANOW );
+ }
+ } elsif ($sort eq 'I') {
+ ; # ignore echoed I frames
} elsif ($sort eq 'B') {
if ($buffered && $outqueue) {
print $stdout $outqueue;
} elsif ($sort eq 'B') {
if ($buffered && $outqueue) {
print $stdout $outqueue;
@@
-163,12
+173,12
@@
sub rec_stdin
unshift @lines, ($lastbit . $first) if ($first);
foreach $first (@lines) {
# print "send_now $call $first\n";
unshift @lines, ($lastbit . $first) if ($first);
foreach $first (@lines) {
# print "send_now $call $first\n";
- $conn->send_now("
D
$call|$first");
+ $conn->send_now("
I
$call|$first");
}
$lastbit = $buf;
$savenl = ""; # reset savenl 'cos we will have done a newline on input
} else {
}
$lastbit = $buf;
$savenl = ""; # reset savenl 'cos we will have done a newline on input
} else {
- $conn->send_now("
D
$call|$buf");
+ $conn->send_now("
I
$call|$buf");
}
} elsif ($r == 0) {
cease(1);
}
} elsif ($r == 0) {
cease(1);
@@
-188,7
+198,7
@@
sub doconnect
if ($port == 23) {
$sock = new Net::Telnet (Timeout => $timeout, BinMode => 1);
$sock->option_accept(Dont => TELOPT_ECHO, Wont => TELOPT_ECHO);
if ($port == 23) {
$sock = new Net::Telnet (Timeout => $timeout, BinMode => 1);
$sock->option_accept(Dont => TELOPT_ECHO, Wont => TELOPT_ECHO);
-
#
$sock->option_log('option_log');
+ $sock->option_log('option_log');
$sock->dump_log('dump');
$sock->open($host) or die "Can't connect to $host port $port $!";
} else {
$sock->dump_log('dump');
$sock->open($host) or die "Can't connect to $host port $port $!";
} else {
diff --git
a/perl/cluster.pl
b/perl/cluster.pl
index 55b3fb919fcabc533f1f3da104080631207b33a3..b4cb11c0a898700d842a072e0c0d218e40ee1eac 100755
(executable)
--- a/
perl/cluster.pl
+++ b/
perl/cluster.pl
@@
-164,13
+164,13
@@
sub process_inqueue
my ($sort, $call, $line) = $data =~ /^(\w)(\S+)\|(.*)$/;
# do the really sexy console interface bit! (Who is going to do the TK interface then?)
my ($sort, $call, $line) = $data =~ /^(\w)(\S+)\|(.*)$/;
# do the really sexy console interface bit! (Who is going to do the TK interface then?)
- dbg('chan', "<- $sort $call $line\n");
+ dbg('chan', "<- $sort $call $line\n")
unless $sort eq 'D'
;
# handle A records
my $user = $dxchan->user;
if ($sort eq 'A' || $sort eq 'O') {
$dxchan->start($line, $sort);
# handle A records
my $user = $dxchan->user;
if ($sort eq 'A' || $sort eq 'O') {
$dxchan->start($line, $sort);
- } elsif ($sort eq '
D
') {
+ } elsif ($sort eq '
I
') {
die "\$user not defined for $call" if !defined $user;
# normal input
die "\$user not defined for $call" if !defined $user;
# normal input
@@
-179,6
+179,8
@@
sub process_inqueue
disconnect($dxchan) if ($dxchan->{state} eq 'bye');
} elsif ($sort eq 'Z') {
disconnect($dxchan);
disconnect($dxchan) if ($dxchan->{state} eq 'bye');
} elsif ($sort eq 'Z') {
disconnect($dxchan);
+ } elsif ($sort eq 'D') {
+ ; # ignored (an echo)
} else {
print STDERR atime, " Unknown command letter ($sort) received from $call\n";
}
} else {
print STDERR atime, " Unknown command letter ($sort) received from $call\n";
}