added IP address logging for connections
[spider.git] / perl / DXProt.pm
index f8a13407cec649ff03b2b2eea508d98e462cc898..e78d9a7a20fb0e2f2afe27e671e2cae00c430954 100644 (file)
@@ -216,6 +216,10 @@ sub start
        my ($self, $line, $sort) = @_;
        my $call = $self->{call};
        my $user = $self->{user};
+
+       # log it
+       my $host = $self->{conn}->{peerhost} || "unknown";
+       Log('DXProt', "$call connected from $host");
        
        # remember type of connection
        $self->{consort} = $line;
@@ -267,8 +271,6 @@ sub start
 
        # send info to all logged in thingies
        $self->tell_login('loginn');
-
-       Log('DXProt', "$call connected");
 }
 
 #
@@ -1044,7 +1046,7 @@ sub normal
                                                                        shift @{$tochan->{pingtime}} if @{$tochan->{pingtime}} > 6;
 
                                                                        # cope with a missed ping, this means you must set the pingint large enough
-                                                                       if ($tochan->is_arcluster && $t > $tochan->{pingint}  && $t < 2 * $tochan->{pingint} ) {
+                                                                       if ($t > $tochan->{pingint}  && $t < 2 * $tochan->{pingint} ) {
                                                                                $t -= $tochan->{pingint};
                                                                        }
 
@@ -1052,7 +1054,7 @@ sub normal
                                                                        if (@{$tochan->{pingtime}} == 1) {
                                                                                $tochan->{pingave} = $t;
                                                                        } else {
-                                                                               $tochan->{pingave} = $tochan->{pingave} + (($t - $tochan->{pingave}) / 8);
+                                                                               $tochan->{pingave} = $tochan->{pingave} + (($t - $tochan->{pingave}) / 6);
                                                                        }
 #                                                                      my $st;
 #                                                                      for (@{$tochan->{pingtime}}) {
@@ -1916,12 +1918,13 @@ sub in_filter_route
 sub eph_dup
 {
        my $s = shift;
+       my $r;
 
        # chop the end off
        $s =~ s/\^H\d\d?\^?\~?$//;
-       return 1 if exists $eph{$s};
+       $r = 1 if exists $eph{$s};    # pump up the dup if it keeps circulating
        $eph{$s} = $main::systime;
-       return undef;
+       return $r;
 }
 
 sub eph_del_regex
@@ -1940,7 +1943,7 @@ sub eph_clean
        my ($key, $val);
        
        while (($key, $val) = each %eph) {
-               if ($main::systime - $val > 90) {
+               if ($main::systime - $val > 180) {
                        delete $eph{$key};
                }
        }