make investigate a bit faster by sending pings per interface
[spider.git] / perl / DXProt.pm
index 8903f12195fcb539107345b5bbc584ac19ae3382..d4d5491aaed7d24144ea21e195d691c10baa59c6 100644 (file)
@@ -73,7 +73,7 @@ $eph_pc34_restime = 30;
 $pingint = 5*60;
 $obscount = 2;
 $chatdupeage = 20 * 60 * 60;
-$investigation_int = 7*86400;  # time between checks to see if we can see this node
+$investigation_int = 12*60*60; # time between checks to see if we can see this node
 $pc19_version = 5466;                  # the visible version no for outgoing PC19s generated from pc59
 
 @checklist = 
@@ -695,8 +695,9 @@ sub handle_16
        unless ($ncall eq $self->{call} || $self->is_believed($ncall)) {
                if (my $ivp = Investigate::get($ncall, $self->{call})) {
                        $ivp->store_pcxx($pcno,$line,$origin,@_);
+               } else {
+                       dbg("PCPROT: We don't believe $ncall on $self->{call}") if isdbg('chanerr');
                }
-               dbg("PCPROT: We don't believe $ncall on $self->{call}");
                return;
        }
 
@@ -848,8 +849,9 @@ sub handle_17
        unless ($ncall eq $self->{call} || $self->is_believed($ncall)) {
                if (my $ivp = Investigate::get($ncall, $self->{call})) {
                        $ivp->store_pcxx($pcno,$line,$origin,@_);
+               } else {
+                       dbg("PCPROT: We don't believe $ncall on $self->{call}") if isdbg('chanerr');
                }
-               dbg("PCPROT: We don't believe $ncall on $self->{call}");
                return;
        }
 
@@ -949,13 +951,13 @@ sub handle_19
                        my $user = DXUser->get_current($origin);
                        if (!$user) {
                                $user = DXUser->new($origin);
-                               $user->sort('S');
                                $user->priv(1);         # I have relented and defaulted nodes
                                $user->lockout(1);
                                $user->homenode($origin);
                                $user->node($origin);
                                $user->wantroutepc19(1);
                        }
+                       $user->sort('A') unless $user->is_node;
                        $user->put;
                }
                $parent = $op;
@@ -988,12 +990,12 @@ sub handle_19
                my $user = DXUser->get_current($call);
                if (!$user) {
                        $user = DXUser->new($call);
-                       $user->sort('A');
                        $user->priv(1);         # I have relented and defaulted nodes
                        $user->lockout(1);
                        $user->homenode($call);
                        $user->node($call);
                }
+               $user->sort('A') unless $user->is_node;
 
                # do we believe this call?
                my $genline = "PC19^$here^$call^$conf^$ver^$_[-1]^"; 
@@ -1005,8 +1007,9 @@ sub handle_19
                                $ivp->here($here);
                                $ivp->store_pcxx($pcno,$genline,$origin,'PC19',$here,$call,$conf,$ver,$_[-1]);
                        } else {
-                               dbg("PCPROT: We don't believe $call on $self->{call}");
+                               dbg("PCPROT: We don't believe $call on $self->{call}") if isdbg('chanerr');
                        }
+                       $user->put;
                        next;
                }
 
@@ -1100,8 +1103,9 @@ sub handle_21
        unless ($call eq $self->{call} || $self->is_believed($call)) {
                if (my $ivp = Investigate::get($call, $self->{call})) {
                        $ivp->store_pcxx($pcno,$line,$origin,@_);
+               } else {
+                       dbg("PCPROT: We don't believe $call on $self->{call}") if isdbg('chanerr');
                }
-               dbg("PCPROT: We don't believe $call on $self->{call}");
                return;
        }
 
@@ -2454,7 +2458,7 @@ sub eph_dup
        $s =~ s/\^H\d\d?\^?\~?$//;
        $r = 1 if exists $eph{$s};    # pump up the dup if it keeps circulating
        $eph{$s} = $main::systime + $t;
-       dbg("PCPROT: emphemeral duplicate") if $r && isdbg('chan'); 
+       dbg("PCPROT: emphemeral duplicate") if $r && isdbg('chanerr'); 
        return $r;
 }