projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
remove ALL telnet options
[spider.git]
/
perl
/
ExtMsg.pm
diff --git
a/perl/ExtMsg.pm
b/perl/ExtMsg.pm
index dafa8566be661a1893395c4dfc108f88fe8fe8e8..81b9a1bc33b727798573dc91291e7492b2a33592 100644
(file)
--- a/
perl/ExtMsg.pm
+++ b/
perl/ExtMsg.pm
@@
-29,8
+29,13
@@
sub enqueue
{
my ($conn, $msg) = @_;
unless ($msg =~ /^[ABZ]/) {
{
my ($conn, $msg) = @_;
unless ($msg =~ /^[ABZ]/) {
- if ($msg =~ /^E[-\w]+\|([01])/) {
+ if ($msg =~ /^E[-\w]+\|([01])/
&& $conn->{csort} eq 'telnet'
) {
$conn->{echo} = $1;
$conn->{echo} = $1;
+ if ($1) {
+# $conn->send_raw("\xFF\xFC\x01");
+ } else {
+# $conn->send_raw("\xFF\xFB\x01");
+ }
} else {
$msg =~ s/^[-\w]+\|//;
push (@{$conn->{outqueue}}, $msg . $conn->{lineend});
} else {
$msg =~ s/^[-\w]+\|//;
push (@{$conn->{outqueue}}, $msg . $conn->{lineend});
@@
-53,7
+58,8
@@
sub dequeue
my $conn = shift;
my $msg;
my $conn = shift;
my $msg;
- while ($msg = shift @{$conn->{inqueue}}){
+ while (@{$conn->{inqueue}}){
+ $msg = shift @{$conn->{inqueue}};
dbg('connect', $msg) unless $conn->{state} eq 'C';
$msg =~ s/\xff\xfa.*\xff\xf0|\xff[\xf0-\xfe].//g; # remove telnet options
dbg('connect', $msg) unless $conn->{state} eq 'C';
$msg =~ s/\xff\xfa.*\xff\xf0|\xff[\xf0-\xfe].//g; # remove telnet options
@@
-76,7
+82,7
@@
sub dequeue
} elsif ($conn->{state} eq 'WC') {
if (exists $conn->{cmd} && @{$conn->{cmd}}) {
$conn->_docmd($msg);
} elsif ($conn->{state} eq 'WC') {
if (exists $conn->{cmd} && @{$conn->{cmd}}) {
$conn->_docmd($msg);
-
unless (@{$conn->{cmd}}
) {
+
if ($conn->{state} eq 'WC' && exists $conn->{cmd} && @{$conn->{cmd}} == 0
) {
$conn->{state} = 'C';
&{$conn->{rproc}}($conn, "O$conn->{call}|telnet");
delete $conn->{cmd};
$conn->{state} = 'C';
&{$conn->{rproc}}($conn, "O$conn->{call}|telnet");
delete $conn->{cmd};
@@
-86,8
+92,9
@@
sub dequeue
}
}
if ($conn->{msg} && $conn->{state} eq 'WC' && exists $conn->{cmd} && @{$conn->{cmd}}) {
}
}
if ($conn->{msg} && $conn->{state} eq 'WC' && exists $conn->{cmd} && @{$conn->{cmd}}) {
+ dbg('connect', $conn->{msg});
$conn->_docmd($conn->{msg});
$conn->_docmd($conn->{msg});
-
unless (@{$conn->{cmd}}
) {
+
if ($conn->{state} eq 'WC' && exists $conn->{cmd} && @{$conn->{cmd}} == 0
) {
$conn->{state} = 'C';
&{$conn->{rproc}}($conn, "O$conn->{call}|telnet");
delete $conn->{cmd};
$conn->{state} = 'C';
&{$conn->{rproc}}($conn, "O$conn->{call}|telnet");
delete $conn->{cmd};
@@
-111,8
+118,9
@@
sub new_client {
$conn->{state} = 'WL';
# $conn->send_raw("\xff\xfe\x01\xff\xfc\x01\ff\fd\x22");
# $conn->send_raw("\xff\xfa\x22\x01\x01\xff\xf0");
$conn->{state} = 'WL';
# $conn->send_raw("\xff\xfe\x01\xff\xfc\x01\ff\fd\x22");
# $conn->send_raw("\xff\xfa\x22\x01\x01\xff\xf0");
+# $conn->send_raw("\xFF\xFC\x01");
_send_file($conn, "$main::data/issue");
_send_file($conn, "$main::data/issue");
- $conn->send_raw("
L
ogin: ");
+ $conn->send_raw("
l
ogin: ");
} else {
$conn->disconnect();
}
} else {
$conn->disconnect();
}
@@
-234,6
+242,7
@@
sub _dochat
if ($conn->{abort} && $line =~ /$conn->{abort}/i) {
dbg('connect', "aborted on /$conn->{abort}/");
$conn->disconnect;
if ($conn->{abort} && $line =~ /$conn->{abort}/i) {
dbg('connect', "aborted on /$conn->{abort}/");
$conn->disconnect;
+ delete $conn->{cmd};
return;
}
if ($line =~ /$expect/i) {
return;
}
if ($line =~ /$expect/i) {
@@
-263,6
+272,10
@@
sub _doclient
my @f = split /\s+/, $line;
$conn->{call} = uc $f[0] if $f[0];
$conn->{csort} = $f[1] if $f[1];
my @f = split /\s+/, $line;
$conn->{call} = uc $f[0] if $f[0];
$conn->{csort} = $f[1] if $f[1];
+ $conn->{state} = 'C';
+ &{$conn->{rproc}}($conn, "O$conn->{call}|telnet");
+ delete $conn->{cmd};
+ $conn->{timeout}->del_timer if $conn->{timeout};
}
sub _send_file
}
sub _send_file
@@
-275,7
+288,7
@@
sub _send_file
if ($f) {
while (<$f>) {
chomp;
if ($f) {
while (<$f>) {
chomp;
- $conn->send_
later($_
);
+ $conn->send_
raw($_ . $conn->{lineend}
);
}
$f->close;
}
}
$f->close;
}