X-Git-Url: http://git.indexdata.com/?p=irspy-moved-to-github.git;a=blobdiff_plain;f=lib%2FZOOM%2FIRSpy.pm;h=dcba350a97297ed88899c9cdb0df94ac9b247b24;hp=5b7e28a441c733eebb901abbd80e8fdc27088100;hb=1e23eeb797f1bbe48e3d3977d864a3d148b71597;hpb=c38d223fe97b273f15226ad994260970b4e8d16b diff --git a/lib/ZOOM/IRSpy.pm b/lib/ZOOM/IRSpy.pm index 5b7e28a..dcba350 100644 --- a/lib/ZOOM/IRSpy.pm +++ b/lib/ZOOM/IRSpy.pm @@ -25,6 +25,7 @@ our $VERSION = '1.02'; our $irspy_to_zeerex_xsl = dirname(__FILE__) . '/../../xsl/irspy2zeerex.xsl'; our $debug = 0; our $xslt_max_depth = 250; +our $max_timeout_errors = 3; # Enumeration for callback functions to return @@ -434,6 +435,8 @@ sub check { my $timeout = $this->{timeout}; $this->log("irspy", "beginnning with test '$topname' (timeout $timeout)"); + $timeout = 2; + my $nskipped = 0; my @conn = @{ $this->{connections} }; @@ -442,8 +445,12 @@ sub check { while (1) { my @copy_conn = @conn; # avoid alias problems after splice() my $nconn = scalar(@copy_conn); + + foreach my $i0 (0 .. $#copy_conn) { my $conn = $copy_conn[$i0]; + #warn Dumper($conn); + #print "connection $i0 of $nconn/", scalar(@conn), " is $conn\n"; next if !defined $conn; if (!$conn->current_task()) { @@ -458,6 +465,10 @@ sub check { $conn->log("irspy_test", "checking for next test after '$address'"); $nextaddr = $this->_next_test($address); + if ($nextaddr && $conn->record->zoom_error->{TIMEOUT} >= $max_timeout_errors) { + $conn->log("irspy", "Got to many timeouts, stop testing: " . $conn->record->zoom_error->{TIMEOUT}); + $nextaddr = ""; + } } if (!defined $nextaddr) { $conn->log("irspy", "has no more tests: removing");