]> scm.dxcluster.org Git - spider.git/commitdiff
fix (un)set/registered
authorDirk Koopman <djk@tobit.co.uk>
Tue, 18 Jan 2022 21:02:52 +0000 (21:02 +0000)
committerDirk Koopman <djk@tobit.co.uk>
Tue, 18 Jan 2022 21:02:52 +0000 (21:02 +0000)
Changes
perl/DXProtHandle.pm
perl/DXUser.pm

diff --git a/Changes b/Changes
index f07bfcd1713b91be6898ed19199f92825133263a..f0dd66b2c29dac4c69a90ac923bfdf6d68fe1481 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,3 +1,5 @@
+18Jan22=======================================================================
+1. fix (un)set/registered.
 09Jan22=======================================================================
 1. Add the New Year CTY-3201 prefix data.
 08Jan22=======================================================================
index 23c17f0c34177c4913e07e73d86532de462e1a13..b051fad35c201533c8451443f66e8c95fcc02c17 100644 (file)
@@ -1562,13 +1562,16 @@ sub _decode_pc92_call
        my $build = $part[2] || 0;
        my $ip = $part[3] || '';
        
-       if ($version =~ /[,.]/) {
+       if (is_ipaddr($version)) {
                $ip = $version;
                $version = 0;
        }
-       $version =~ s/\D+//g;
+       $version =~ s/\D//g;
        $build =~ s/^0\.//;
-       $build =~ s/\D+//g;
+       $build =~ s/\D//g;
+       $version ||= 0;
+       $build ||= 0;
+       
        if ($ip) {
         $ip =~ s/,/:/g;
         $ip =~ s/^::ffff://i;
index dd56498e053eb22b2c0ebc7ed69c46151a764d6e..ef4475625499475af86b805324602c50a082097c 100644 (file)
@@ -899,10 +899,15 @@ sub lastping
 sub registered
 {
        my $self = shift;
+       my $val;
+       if (defined $_[0]) {
+               $val = unpad($_[0]);
+               $self->{registered} = $val;
+       }
        if (exists $self->{registered}) {
-               return $self->{registered} || 0;
+               $val = $self->{registered} // 0;
        }
-       return '';                                      # to stop undef warnings
+       return $val // 0 ;                                      # to stop undef warnings
 }
 
 1;