X-Git-Url: http://git.indexdata.com/?p=irspy-moved-to-github.git;a=blobdiff_plain;f=lib%2FZOOM%2FIRSpy.pm;h=62df949b649442351ce489dde006b3f38fbbea4e;hp=0df24d7e18ac8b4bbd246db07bdc9fa709a7413d;hb=8b8593637f459d81a22568df1e3d3a8ff88c4e2d;hpb=715a6bd10c2de57d014127752035efc2fd7f1e5e diff --git a/lib/ZOOM/IRSpy.pm b/lib/ZOOM/IRSpy.pm index 0df24d7..62df949 100644 --- a/lib/ZOOM/IRSpy.pm +++ b/lib/ZOOM/IRSpy.pm @@ -1,4 +1,4 @@ -# $Id: IRSpy.pm,v 1.75 2007-03-09 08:56:37 mike Exp $ +# $Id: IRSpy.pm,v 1.76 2007-03-10 13:02:36 mike Exp $ package ZOOM::IRSpy; @@ -330,10 +330,11 @@ sub check { $conn->log("irspy", "has no more tests: removing"); $this->_rewrite_record($conn); $conn->option(rewrote_record => 1); - $conn->destroy(); if (@{ $this->{queue} } == 0) { + # Do not destroy: we need this for later sanity checks splice @conn, $i0, 1; } else { + $conn->destroy(); $conn[$i0] = create ZOOM::IRSpy::Connection($this, shift @{ $this->{queue} }, async => 1); @@ -468,6 +469,8 @@ sub check { } $this->log("irspy", "exiting main loop"); + return $nskipped; # Sanity-checks don't work if conns are closed + # Sanity checks: none of the following should ever happen my $finished = 1; @conn = @{ $this->{connections} };