From: Stephen L Johnson Date: Thu, 18 Apr 2002 15:39:00 +0000 (+0000) Subject: fixed another exit point with missing alarm(0 reset in check_tcp() X-Git-Tag: spong-2_7_7~12 X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=08346a5fe6c2edc33ce2826e5d69202fa694f2b1;p=spong.git fixed another exit point with missing alarm(0 reset in check_tcp() --- diff --git a/src/spong-network.pl b/src/spong-network.pl index 5993db0..05dff0b 100755 --- a/src/spong-network.pl +++ b/src/spong-network.pl @@ -17,7 +17,7 @@ # (2) Converted checks to new plugin mechanism (Stephen Johnson May 28, 1999) # Added user-configurable escalation mechanism # -# $Id: spong-network.pl,v 1.40 2001/06/20 21:18:54 sljohnson Exp $ +# $Id: spong-network.pl,v 1.41 2002/04/18 15:39:00 sljohnson Exp $ use Carp; use lib "@@LIBDIR@@"; @@ -375,7 +375,8 @@ sub check_tcp { while (length($msg) < $maxlen) { recv( SOCK, $line, 256, 0 ); $msg .= $line; - if (length($line) == 0) { return; } # If the socket is closed, return + # If the socket is closed, exit the loop + if (length($line) == 0) { last; } } alarm(0); close( SOCK ) || die "close: $!";