]> dxcluster.org Git - spider.git/commitdiff
improve instability
authorminima <minima>
Thu, 14 Jun 2001 23:01:24 +0000 (23:01 +0000)
committerminima <minima>
Thu, 14 Jun 2001 23:01:24 +0000 (23:01 +0000)
perl/DXProt.pm
perl/Route/Node.pm

index 3767145ca4277463ca60fe172db9b695f57b8320..f4074ade0470dfeebfea3dfe68c03ad7cf569edc 100644 (file)
@@ -651,8 +651,10 @@ sub normal
                                if ($r) {
                                        my $ar;
                                        if ($call ne $parent->call) {
-                                               $ar = $parent->add($r);
-                                               push @rout, $ar if $ar;
+                                               if ($self->in_filter_route($r)) {
+                                                       $ar = $parent->add($r);
+                                                       push @rout, $ar if $ar;
+                                               }
                                        }
                                        if ($r->version ne $ver || $r->flags != $flags) {
                                                $r->version($ver);
@@ -662,12 +664,10 @@ sub normal
                                } else {
                                        next if $call eq $main::mycall || $call eq $self->{call};
                                        
-                                       my $new = $parent->new($call, $ver, Route::here($here)|Route::conf($conf));
+                                       my $new = Route->new($call);          # throw away
                                    if ($self->in_filter_route($new)) {
-                                               $parent->add($new);
-                                               push @rout, $new;
-                                       } else {
-                                               $new->del($parent);
+                                               my $r = $parent->add($call, $ver, $flags);
+                                               push @rout, $r;
                                        }
                                }
 
@@ -1792,7 +1792,7 @@ sub broadcast_route
        foreach $dxchan (@dxchan) {
                next if $dxchan == $self;
                next if $dxchan == $me;
-               if ($self->{routefilter} || !$self->{isolate}) {
+               if ($dxchan->{routefilter} || !$self->{isolate}) {
                        $dxchan->send_route($generate, @_) 
                } else {
                        dbg('DXPROT: isolated') if isdbg('chanerr');
index 4bb4c9ca4812624e43b6ed9170f7504c1d17c16a..51ecedea2bb6575c9d58220cba96011e696cd9e4 100644 (file)
@@ -56,24 +56,14 @@ sub max
 sub add
 {
        my $parent = shift;
-       my $call = shift;
-       my $self;
-       
-       if (ref $call) {
-               $self = $call;
-               $call = $self->{call};
-       } else {
-               $self = get($call);
-       }
-
-       confess "Trying to add NULL Node call to routing tables" unless $call;
-       
+       my $call = uc shift;
+       confess "Route::add trying to add $call to myself" if $call eq $parent->{call};
+       my $self = get($call);
        if ($self) {
                $self->_addparent($parent->{call});
                $parent->_addnode($call);
                return undef;
        }
-       confess "Route::Node::add trying to add $call to myself" if $call eq $parent->{call};   
        $parent->_addnode($call);
        $self = $parent->new($call, @_);
        return $self;