]> dxcluster.org Git - spider.git/commitdiff
fix a little used logging error for export.
authorminima <minima>
Tue, 1 Nov 2005 20:18:14 +0000 (20:18 +0000)
committerminima <minima>
Tue, 1 Nov 2005 20:18:14 +0000 (20:18 +0000)
perl/DXUser.pm

index cd30264e1d16e54cfaea2d45e57680b2de51e277..3df7fc20b218e42a2afb90da8fa03d0dec82cbf7 100644 (file)
@@ -20,8 +20,10 @@ use LRU;
 use strict;
 
 use vars qw($VERSION $BRANCH);
-
-main::mkver($VERSION = q$Revision$);
+$VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ );
+$BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/  || (0,0));
+$main::build += $VERSION;
+$main::branch += $BRANCH;
 
 use vars qw(%u $dbm $filename %valid $lastoperinterval $lasttime $lru $lrusize $tooold $v3);
 
@@ -297,7 +299,6 @@ sub put
        $lru->put($call, $self);
        my $ref = $self->encode;
        $dbm->put($call, $ref);
-       return $self;
 }
 
 # freeze the user
@@ -481,16 +482,20 @@ print "There are $count user records and $err errors\n";
 
         for ($action = R_FIRST; !$dbm->seq($key, $val, $action); $action = R_NEXT) {
                        if (!is_callsign($key) || $key =~ /^0/) {
-                               Log('DXCommand', "Export Error1: $key\t$val");
+                               my $eval = $val;
+                               my $ekey = $key;
+                               $eval =~ s/([\%\x00-\x1f\x7f-\xff])/sprintf("%%%02X", ord($1))/eg; 
+                               $ekey =~ s/([\%\x00-\x1f\x7f-\xff])/sprintf("%%%02X", ord($1))/eg; 
+                               Log('DXCommand', "Export Error1: $ekey\t$eval");
                                eval {$dbm->del($key)};
-                               dbg(carp("Export Error1: $key\t$val\n$@")) if $@;
+                               dbg(carp("Export Error1: $ekey\t$eval\n$@")) if $@;
                                ++$err;
                                next;
                        }
                        my $ref = decode($val);
                        if ($ref) {
                                my $t = $ref->{lastin} || 0;
-                               if ($main::systime > $t + $tooold) {
+                               if ($ref->{sort} eq 'U' && !$ref->{priv} && $main::systime > $t + $tooold) {
                                        unless ($ref->{lat} && $ref->{long} || $ref->{qth} || $ref->{qra}) {
                                                eval {$dbm->del($key)};
                                                dbg(carp("Export Error2: $key\t$val\n$@")) if $@;
@@ -725,12 +730,6 @@ sub is_node
        return $self->{sort} =~ /[ACRSX]/;
 }
 
-sub is_aranea
-{
-       my $self = shift;
-       return $self->{sort} eq 'W';
-}
-
 sub is_user
 {
        my $self = shift;