fix msg aging
authorminima <minima>
Mon, 21 Oct 2002 14:20:19 +0000 (14:20 +0000)
committerminima <minima>
Mon, 21 Oct 2002 14:20:19 +0000 (14:20 +0000)
make pingint and obscount defaults set/var able

Changes
cmd/Commands_en.hlp
perl/DXMsg.pm
perl/DXProt.pm
perl/DXUtil.pm

diff --git a/Changes b/Changes
index 5abd7d0730b4206c0eb9eb653b9b71619b5da79a..666930a5e713afd15dc50f7418d262346574a8ec 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,3 +1,7 @@
+21Oct02=======================================================================
+1. Fix msg aging.
+2. make the default pinginterval and obscount variable (set/var 
+$DXProt::pingint and $DXProt::obscount) 
 20Oct02=======================================================================
 1. remove dupe check on local sysop announces
 2. fix format errors on sh/muf for 5.8.0
 20Oct02=======================================================================
 1. remove dupe check on local sysop announces
 2. fix format errors on sh/muf for 5.8.0
index 11032115d4315c62ba26a87a4cbd8472eef888db..66194e1bab3e6e9cf7fcf64ee180c720581e2059 100644 (file)
@@ -1504,7 +1504,7 @@ Tell the system what your name is eg:-
 Tell the system that the call(s) are to be treated as AK1A cluster and
 fed PC Protocol rather normal user commands.
 
 Tell the system that the call(s) are to be treated as AK1A cluster and
 fed PC Protocol rather normal user commands.
 
-=== 8^SET/OBSCOUNT <count> <nodecall>^Set the 'pump-up' obscelence counter 
+=== 8^SET/OBSCOUNT <count> <call>^Set the 'pump-up' obscelence PING counter 
 From 1.35 onwards neighbouring nodes are pinged at regular intervals (see
 SET/PINGINTERVAL), usually 300 seconds or 5 minutes. There is a 'pump-up'
 counter which is decremented on every outgoing ping and then reset to
 From 1.35 onwards neighbouring nodes are pinged at regular intervals (see
 SET/PINGINTERVAL), usually 300 seconds or 5 minutes. There is a 'pump-up'
 counter which is decremented on every outgoing ping and then reset to
index 10d1e4dc77bb816157501d3bf30a66a2f4d0431f..e859808596b7c8fb3542f1a63723f4e06bc40a45 100644 (file)
@@ -125,7 +125,7 @@ sub alloc
        $self->{'read'} = shift;
        $self->{rrreq} = shift;
        $self->{delete} = shift;
        $self->{'read'} = shift;
        $self->{rrreq} = shift;
        $self->{delete} = shift;
-       $self->{deletetime} = shift;
+       $self->{deletetime} = shift || $self->{delete} ? 0 : ($self->{t} + $maxage);
        $self->{gotit} = [];
 #      $self->{lastt} = $main::systime;
        $self->{lines} = [];
        $self->{gotit} = [];
 #      $self->{lastt} = $main::systime;
        $self->{lines} = [];
@@ -155,6 +155,15 @@ sub process
 
                # clean the message queue
                clean_old() if $main::systime - $last_clean > 3600 ;
 
                # clean the message queue
                clean_old() if $main::systime - $last_clean > 3600 ;
+
+               # actual remove all the 'deleted' messages in one hit.
+               # this has to be delayed until here otherwise it only does one at 
+               # a time because @msg is rewritten everytime del_msg is called.
+               my @del = grep {!$_->{tonode} && $_->{delete} && $_->{deletetime} < $main::systime} @msg;
+               for (@del) {
+                       $_->del_msg;
+               }
+
                $last_clean = $main::systime;
                return;
        }
                $last_clean = $main::systime;
                return;
        }
@@ -512,7 +521,7 @@ sub store
                        my $rr = $ref->{rrreq} ? '1' : '0';
                        my $priv = $ref->{private} ? '1': '0';
                        my $del = $ref->{delete} ? '1' : '0';
                        my $rr = $ref->{rrreq} ? '1' : '0';
                        my $priv = $ref->{private} ? '1': '0';
                        my $del = $ref->{delete} ? '1' : '0';
-                       my $delt = $ref->{deletetime} || '0';
+                       my $delt = $ref->{deletetime} || $ref->{t} + $maxage;
                        print $fh "=== $ref->{msgno}^$ref->{to}^$ref->{from}^$ref->{t}^$priv^$ref->{subject}^$ref->{origin}^$ref->{'read'}^$rr^$del^$delt\n";
                        print $fh "=== ", join('^', @{$ref->{gotit}}), "\n";
                        my $line;
                        print $fh "=== $ref->{msgno}^$ref->{to}^$ref->{from}^$ref->{t}^$priv^$ref->{subject}^$ref->{origin}^$ref->{'read'}^$rr^$del^$delt\n";
                        print $fh "=== ", join('^', @{$ref->{gotit}}), "\n";
                        my $line;
@@ -530,13 +539,6 @@ sub store
                }
        }
 
                }
        }
 
-       # actual remove all the 'deleted' messages in one hit.
-       # this has to be delayed until here otherwise it only does one at 
-       # a time because @msg is rewritten everytime del_msg is called.
-       my @del = grep {!$_->{tonode} && $_->{delete} && $_->{deletetime} < $main::systime} @msg;
-       for (@del) {
-               $_->del_msg;
-       }
 }
 
 # delete a message
 }
 
 # delete a message
@@ -589,7 +591,7 @@ sub clean_old
        
        # mark old messages for deletion
        foreach $ref (@msg) {
        
        # mark old messages for deletion
        foreach $ref (@msg) {
-               if (ref($ref) && !$ref->{keep} && $ref->{t} < $main::systime - $maxage) {
+               if (ref($ref) && !$ref->{keep} && $ref->{deletetime} < $main::systime) {
 
                        # this is for IMMEDIATE destruction
                        $ref->{delete}++;
 
                        # this is for IMMEDIATE destruction
                        $ref->{delete}++;
index f0fe0c6e71b8a82e0813637969d70020997fec00..330e7a60eba433069a65a217ad5ebbb56ae91312 100644 (file)
@@ -44,6 +44,7 @@ $main::branch += $BRANCH;
 
 use vars qw($pc11_max_age $pc23_max_age $last_pc50 $eph_restime $eph_info_restime $eph_pc34_restime
                        $last_hour $last10 %eph  %pings %rcmds $ann_to_talk
 
 use vars qw($pc11_max_age $pc23_max_age $last_pc50 $eph_restime $eph_info_restime $eph_pc34_restime
                        $last_hour $last10 %eph  %pings %rcmds $ann_to_talk
+                       $pingint $obscount
                        %nodehops $baddx $badspotter $badnode $censorpc $rspfcheck
                        $allowzero $decode_dk0wcy $send_opernam @checklist);
 
                        %nodehops $baddx $badspotter $badnode $censorpc $rspfcheck
                        $allowzero $decode_dk0wcy $send_opernam @checklist);
 
@@ -65,6 +66,8 @@ $rspfcheck = 1;
 $eph_restime = 180;
 $eph_info_restime = 60*60;
 $eph_pc34_restime = 30;
 $eph_restime = 180;
 $eph_info_restime = 60*60;
 $eph_pc34_restime = 30;
+$pingint = 5*60;
+$obscount = 2;
 
 @checklist = 
 (
 
 @checklist = 
 (
@@ -255,9 +258,9 @@ sub start
        
        # ping neighbour node stuff
        my $ping = $user->pingint;
        
        # ping neighbour node stuff
        my $ping = $user->pingint;
-       $ping = 5*60 unless defined $ping;
+       $ping = $pingint unless defined $ping;
        $self->{pingint} = $ping;
        $self->{pingint} = $ping;
-       $self->{nopings} = $user->nopings || 2;
+       $self->{nopings} = $user->nopings || $obscount;
        $self->{pingtime} = [ ];
        $self->{pingave} = 999;
        $self->{metric} ||= 100;
        $self->{pingtime} = [ ];
        $self->{pingave} = 999;
        $self->{metric} ||= 100;
index e497a6e9df6c2febbca7c1aa3354ef2e234f7d11..219e9f3bed6c3cdff7fdb1601eb1308c7e4be21e 100644 (file)
@@ -149,6 +149,7 @@ sub promptf
                $dd->Terse(1);
                $dd->Quotekeys(0);
                $value = $dd->Dumpxs;
                $dd->Terse(1);
                $dd->Quotekeys(0);
                $value = $dd->Dumpxs;
+               $value =~ s/([\r\n\t])/sprintf("%%%02X", ord($1))/eg;
        }
        $prompt = sprintf "%15s: %s", $prompt, $value;
        return ($priv, $prompt);
        }
        $prompt = sprintf "%15s: %s", $prompt, $value;
        return ($priv, $prompt);