Limit depth of recursion for route finding
[spider.git] / perl / Route.pm
index 868317a9646234b9093a2598048a3a795f71e8d3..769aefe8c01525e2d576540deb150432459bbbbd 100644 (file)
@@ -295,8 +295,12 @@ sub findroutes
 
        dbg("findroutes: $call level: $level calls: " . join(',', @_)) if isdbg('routec');
 
-       # recursion detector
+       # recursion detector (no point in recursing that deeply)
        return () if $seen->{$call};
+       if ($level >= 20) {
+               dbg("Route::findroutes: recursion limit reached looking for $call");
+               return ();
+       }
 
        # return immediately if we are directly connected
        if (my $dxchan = DXChannel::get($call)) {