]> dxcluster.org Git - spider.git/commitdiff
rearrange priv/lock tests independent of node type
authorDirk Koopman <djk@tobit.co.uk>
Tue, 30 Apr 2024 16:14:09 +0000 (17:14 +0100)
committerDirk Koopman <djk@tobit.co.uk>
Tue, 30 Apr 2024 16:14:09 +0000 (17:14 +0100)
perl/DXProtHandle.pm

index dc27225d25677691108e67f5724fa46d7dc48914..ffe91741f5091a39259d740bbe274654a9a5f8e7 100644 (file)
@@ -2205,16 +2205,20 @@ sub handle_92
                                        $user->build($parent->build($build));
                                        ++$changed;
                                }
+
                                if ($oldsort ne 'S') {
                                        $user->sort('S');
-                                       unless (DXChannel::get($user->call)) { # only do this if not connected
-                                               my $oldpriv = $user->priv;
-                                               my $oldlock = $user->lockout;
-                                               $user->priv(1) unless defined $oldpriv && $oldpriv;
-                                               $user->lockout(1) unless defined $oldlock;
-                                               dbg(sprintf "PCPROT: PC92 K rec, node $call updated sort: $oldsort->S priv: '$oldpriv'->%d lockout: '$oldlock'->%s", $user->priv || 0, $user->lockout || 0);
-                                               ++$changed;
-                                       }
+                                       dbg(sprintf "PCPROT: PC92 K rec, node $call updated sort: $oldsort->S");
+                                       ++$changed;
+                               }
+                               
+                               unless (DXChannel::get($user->call)) { # only do this if not connected
+                                       my $oldpriv = $user->priv;
+                                       my $oldlock = $user->lockout;
+                                       my $lastchanged = $changed;
+                                       $user->priv(1), ++$changed unless defined $oldpriv && $oldpriv;
+                                       $user->lockout(1), ++$changed unless defined $oldlock;
+                                       dbg(sprintf "PCPROT: PC92 K rec, node $call updated priv: '$oldpriv'->%d lockout: '$oldlock'->%s", $user->priv || 0, $user->lockout || 0) if $lastchanged != $changed;
                                }
                                unless ($user->K) {
                                        dbg(sprintf "PCPROT: PC92 K rec, node $call updated - marked as sending PC92 K records priv: %d lockout: %d ", $user->priv || 0, $user->lockout || 0);