projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add some extra info around connects for tracking connections
[spider.git]
/
perl
/
ExtMsg.pm
diff --git
a/perl/ExtMsg.pm
b/perl/ExtMsg.pm
index ae6c8a4c447a8d6bd5d56b528634589593f49b1b..8a5e4612926b9b5da6a8212f6404090f62c78fab 100644
(file)
--- a/
perl/ExtMsg.pm
+++ b/
perl/ExtMsg.pm
@@
-115,9
+115,8
@@
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->_send_file("$main::data/connected");
- Msg->sleep(1);
&{$conn->{rproc}}($conn, "$dir$call|$sort");
&{$conn->{rproc}}($conn, "$dir$call|$sort");
+ $conn->_send_file("$main::data/connected");
}
sub new_client {
}
sub new_client {
@@
-130,6
+129,7
@@
sub new_client {
$conn->{blocking} = 0;
my ($rproc, $eproc) = &{$server_conn->{rproc}} ($conn, $conn->{peerhost} = $sock->peerhost(), $conn->{peerport} = $sock->peerport());
$conn->{blocking} = 0;
my ($rproc, $eproc) = &{$server_conn->{rproc}} ($conn, $conn->{peerhost} = $sock->peerhost(), $conn->{peerport} = $sock->peerport());
+ dbg('connll', "accept $conn->{cnum} from $conn->{peerhost} $conn->{peerport}");
if ($eproc) {
$conn->{eproc} = $eproc;
Msg::set_event_handler ($sock, "error" => $eproc);
if ($eproc) {
$conn->{eproc} = $eproc;
Msg::set_event_handler ($sock, "error" => $eproc);
@@
-253,7
+253,7
@@
sub _doconnect
*STDOUT = IO::File->new_from_fd($b, 'w') or die;
*STDERR = IO::File->new_from_fd($b, 'w') or die;
close $a;
*STDOUT = IO::File->new_from_fd($b, 'w') or die;
*STDERR = IO::File->new_from_fd($b, 'w') or die;
close $a;
- unless ($
^O =~ /^MS/
) {
+ unless ($
main::is_win
) {
# $SIG{HUP} = 'IGNORE';
$SIG{HUP} = $SIG{CHLD} = $SIG{TERM} = $SIG{INT} = 'DEFAULT';
alarm(0);
# $SIG{HUP} = 'IGNORE';
$SIG{HUP} = $SIG{CHLD} = $SIG{TERM} = $SIG{INT} = 'DEFAULT';
alarm(0);
@@
-319,8
+319,10
@@
sub _dochat
return;
}
if ($line =~ /\Q$expect/i) {
return;
}
if ($line =~ /\Q$expect/i) {
- dbg('connect', "got: \"$expect\" sending: \"$send\"");
- $conn->send_later("D$conn->{call}|$send");
+ if (length $send) {
+ dbg('connect', "got: \"$expect\" sending: \"$send\"");
+ $conn->send_later("D$conn->{call}|$send");
+ }
delete $conn->{msg}; # get rid any input if a match
return;
}
delete $conn->{msg}; # get rid any input if a match
return;
}
@@
-334,8
+336,6
@@
sub _timedout
{
my $conn = shift;
dbg('connect', "timed out after $conn->{timeval} seconds");
{
my $conn = shift;
dbg('connect', "timed out after $conn->{timeval} seconds");
- $conn->{timeout}->del;
- delete $conn->{timeout};
$conn->disconnect;
}
$conn->disconnect;
}
@@
-364,7
+364,9
@@
sub _send_file
if ($f) {
while (<$f>) {
chomp;
if ($f) {
while (<$f>) {
chomp;
- $conn->send_raw($_ . $conn->{lineend});
+ my $l = $_;
+ dbg('connll', "connect $conn->{cnum}: $l");
+ $conn->send_raw($l . $conn->{lineend});
}
$f->close;
}
}
$f->close;
}