]> gb7djk.dxcluster.net Git - spider.git/blobdiff - perl/ExtMsg.pm
add some extra info around connects for tracking connections
[spider.git] / perl / ExtMsg.pm
index 4475f6a10cbf6623f5c8f12163acb6cf14f97198..8a5e4612926b9b5da6a8212f6404090f62c78fab 100644 (file)
@@ -129,6 +129,7 @@ sub new_client {
                $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);
@@ -335,8 +336,6 @@ sub _timedout
 {
        my $conn = shift;
        dbg('connect', "timed out after $conn->{timeval} seconds");
-       $conn->{timeout}->del;
-       delete $conn->{timeout};
        $conn->disconnect;
 }
 
@@ -365,8 +364,9 @@ sub _send_file
                if ($f) {
                        while (<$f>) {
                                chomp;
-                               dbg('connll', $_);
-                               $conn->send_raw($_ . $conn->{lineend});
+                               my $l = $_;
+                               dbg('connll', "connect $conn->{cnum}: $l");
+                               $conn->send_raw($l . $conn->{lineend});
                        }
                        $f->close;
                }