1. Added an efficiency thing for AUTOLOADed accessors from OO Perl by Conway.
[spider.git] / perl / DXMsg.pm
index 65577607be6d30635f2053e417df6b98b3de7fa0..5c990177330ddc26c55fd20ccd7a0fcf242e49b1 100644 (file)
@@ -136,7 +136,7 @@ sub process
        # this is periodic processing
        if (!$self || !$line) {
 
-               if ($main::systime > $lastq + $queueinterval) {
+               if ($main::systime >= $lastq + $queueinterval) {
 
                        # wander down the work queue stopping any messages that have timed out
                        for (keys %busy) {
@@ -616,7 +616,7 @@ sub queue_msg
                        next if $ref->{'read'};           # if it is read, it is stuck here
                        $clref = DXCluster->get_exact($ref->{to});
                        unless ($clref) {             # otherwise look for a homenode
-                               my $uref = DXUser->get($ref->{to});
+                               my $uref = DXUser->get_current($ref->{to});
                                my $hnode =  $uref->homenode if $uref;
                                $clref = DXCluster->get_exact($hnode) if $hnode;
                        }
@@ -1235,6 +1235,9 @@ sub AUTOLOAD
        $name =~ s/.*:://o;
        
        confess "Non-existant field '$AUTOLOAD'" if !$valid{$name};
+       # this clever line of code creates a subroutine which takes over from autoload
+       # from OO Perl - Conway
+       *{$AUTOLOAD} = sub {@_ > 1 ? $_[0]->{$name} = $_[1] : $_[0]->{$name}} ;
        @_ ? $self->{$name} = shift : $self->{$name} ;
 }