+08Jun20=======================================================================
+1. Fix show/mydx (lack of) filtering bug.
+2. Add qra locator to prefix_data.pl
+3. Add 4 digit qra square for spotted callsign if show/dxgrid is enabled
03Jun20=======================================================================
1. Make sure that all possible regexes get passed across to the search engine.
2. Fix out of order logging on sh/log queries spanning more than one month.
my $pingint = $dxchan->pingint;
my $lastt = $dxchan->lastping ? ($dxchan->pingint - ($nowt - $dxchan->lastping)) : $pingint;
my $ping = $dxchan->is_node && $dxchan != $main::me ? sprintf("%7.2f",$dxchan->pingave) : "";
- my $iso = $dxchan->isolate ? 'Y' :' ';
+ my $iso = $dxchan->isolate ? 'Y' : ' ';
my $uptime = difft($dxchan->startt, 1);
my ($fin, $fout, $pc92) = (' ', ' ', ' ');
if ($dxchan->do_pc9x) {
}
unless ($pingint) {
$lastt = 0;
- $ping = " ";
+ $ping = " ";
}
$sort = "DXSP" if $dxchan->is_spider;
return (0, "sh/dx parse error '$r' " . $filter) if $r;
$user ||= '';
+ $expr ||= '';
dbg "sh/dx user: $user expr: $expr from: $from to: $to fromday: $fromday today: $today" if isdbg('sh/dx');
# now do the search
my $loc = '';
my $clth = $self->{consort} eq 'local' ? 29 : 30;
my $comment = substr (($_[3] || ''), 0, $clth);
- $comment .= ' ' x ($clth - length($comment));
+ $comment .= ' ' x ($clth - (length($comment)));
+ if ($self->{user}->wantgrid) {
+ my $ref = DXUser::get_current($_[1]);
+ if ($ref && $ref->qra) {
+ $loc = ' ' . substr($ref->qra, 0, 4);
+ $comment = substr $comment, 0, ($clth - (length($comment)+length($loc)));
+ $comment .= $loc;
+ $loc = '';
+ }
+ }
+
if ($self->{user}->wantgrid) {
my $ref = DXUser::get_current($_[4]);
- if ($ref) {
- $loc = $ref->qra || '';
- $loc = ' ' . substr($loc, 0, 4) if $loc;
+ if ($ref && $ref->qra) {
+ $loc = ' ' . substr($ref->qra, 0, 4);
}
}
$filename = undef;
$lastoperinterval = 60*24*60*60;
$lasttime = 0;
-$lrusize = 2000;
+$lrusize = 10000;
$tooold = 86400 * 365; # this marks an old user who hasn't given enough info to be useful
$v3 = 0;
our $maxconnlist = 3; # remember this many connection time (duration) [start, end] pairs
email => '0,E-mail Address,parray',
priv => '9,Privilege Level',
lastin => '0,Last Time in,cldatetime',
+ lastseen => '0,Last Seen,cldatetime',
passwd => '9,Password,yesno',
passphrase => '9,Pass Phrase,yesno',
addr => '0,Full Address',
sub finish
{
+ $dbm->sync;
undef $dbm;
untie %u;
}
# confess "can't create existing call $call in User\n!" if $u{$call};
my $self = $pkg->alloc($call);
+ $self->{lastseen} = $main::systime;
$self->put;
return $self;
}
# is it in the LRU cache?
my $ref = $lru->get($call);
- return $ref if $ref && ref $ref eq 'DXUser';
+ if ($ref && ref $ref eq 'DXUser') {
+ $ref->{lastseen} = $main::systime;
+ return $ref;
+ }
# search for it
unless ($dbm->get($call, $data)) {
}
return undef;
}
+ $ref->{lastseen} = $main::systime;
$lru->put($call, $ref);
return $ref;
}
my $self = shift;
my $startt = shift;
my $ip = shift;
- $self->{lastin} = $main::systime;
+ $self->{lastseen} = $self->{lastin} = $main::systime;
# add a record to the connect list
my $ref = [$startt || $self->{startt}, $main::systime];
push @$ref, $ip if $ip;
use vars qw(@ISA);
@ISA = qw(Chain);
+use constant OBJ => 2;
+use constant MAX => 3;
+use constant INUSE => 4;
+use constant NAME => 5;
+use constant CALLBACK => 6;
+
sub newbase
{
my $pkg = shift;
my $name = shift;
my $max = shift;
+ my $callback = shift;
confess "LRU->newbase requires a name and maximal count" unless $name && $max;
- return $pkg->SUPER::new({ }, $max, 0, $name);
+ return $pkg->SUPER::new({ }, $max, 0, $name, $callback);
}
sub get
{
my ($self, $call) = @_;
if (my $p = $self->obj->{$call}) {
- dbg("LRU $self->[5] cache hit $call") if isdbg('lru');
+ dbg("LRU $self->[NAME] cache hit $call") if isdbg('lru');
$self->rechain($p);
return $p->obj;
}
my $p = $self->obj->{$call};
if ($p) {
# update the reference and rechain it
- dbg("LRU $self->[5] cache update $call") if isdbg('lru');
+ dbg("LRU $self->[NAME] cache update $call") if isdbg('lru');
$p->obj($ref);
$self->rechain($p);
} else {
# delete one of the end of the chain if required
- while ($self->[4] >= $self->[3] ) {
+ while ($self->[INUSE] >= $self->[MAX] ) {
$p = $self->prev;
- my $call = $p->[3];
- dbg("LRU $self->[5] cache LRUed out $call now $self->[4]/$self->[3]") if isdbg('lru');
+ my $call = $p->[MAX];
+ dbg("LRU $self->[NAME] cache LRUed out $call now $self->[INUSE]/$self->[MAX]") if isdbg('lru');
$self->remove($call);
}
# add a new one
- dbg("LRU $self->[5] cache add $call now $self->[4]/$self->[3]") if isdbg('lru');
+ dbg("LRU $self->[NAME] cache add $call now $self->[INUSE]/$self->[MAX]") if isdbg('lru');
$p = $self->new($ref, $call);
$self->add($p);
$self->obj->{$call} = $p;
- $self->[4]++;
+ $self->[INUSE]++;
}
}
sub remove
{
my ($self, $call) = @_;
- my $q = $self->obj->{$call};
- confess("$call is already removed") unless $q;
- dbg("LRU $self->[5] cache remove $call now $self->[4]/$self->[3]") if isdbg('lru');
- $q->obj(1);
- $q->SUPER::del;
+ my $p = $self->obj->{$call};
+ confess("$call is already removed") unless $p;
+ dbg("LRU $self->[NAME] cache remove $call now $self->[INUSE]/$self->[MAX]") if isdbg('lru');
+ &{$self->[CALLBACK]}($p->obj) if $self->[CALLBACK]; # call back if required
+ $p->obj(1);
+ $p->SUPER::del;
delete $self->obj->{$call};
- $self->[4]--;
+ $self->[INUSE]--;
}
sub count
{
- return $_[0]->[4];
+ return $_[0]->[INUSE];
}
1;
%prefix_loc = (); # the meat of the info
%pre = (); # the prefix list
$hits = $misses = $matchtotal = 1; # cache stats
-$lrusize = 1000; # size of prefix LRU cache
+$lrusize = 10000; # size of prefix LRU cache
sub init
{
our @ISA = qw(DXChannel);
-our $startup_delay =5*60; # don't send anything out until this timer has expired
+our $startup_delay =3*60; # don't send anything out until this timer has expired
# this is to allow the feed to "warm up" with duplicates
# so that the "big rush" doesn't happen.
while (<$fh>) {
my @r = split /\^/;
++$rec;
+ if ($dxchan) {
+ my ($gotone, undef) = $dxchan->{spotsfilter}->it(@r);
+ next unless $gotone;
+ }
if (&$ecode(\@r)) {
++$count;
next if $count < $from;
- push @out, \@r;
- last if $count >= $to;
+ if ($readback) {
+ push @out, \@r;
+ last if $count >= $to;
+ } else {
+ push @out, \@r;
+ shift @out if $count >= $to;
+ }
}
}
dbg("Spot::search recs read: $rec") if isdbg('search');
return sprintf "%8.1f %-11s %s %s %-28.28s%7s>", $_[0], $_[1], $d, $t, ($_[3]||''), "<$_[4]" ;
}
-#
-# return all the spots from a day's file as an array of references
-# the parameter passed is a julian day
-sub readfile($)
-{
- my @spots;
-
- my $fh = $fp->open(shift);
- if ($fh) {
- my $in;
- while (<$fh>) {
- chomp;
- push @spots, [ split '\^' ];
- }
- }
- return @spots;
-}
-
# enter the spot for dup checking and return true if it is already a dup
sub dup
{