--- projects/cms/source/host/ihost-perl/ihost.pl 2001/03/01 10:49:27 1.22 +++ projects/cms/source/host/ihost-perl/ihost.pl 2001/03/01 18:53:42 1.23 @@ -10,7 +10,7 @@ # - pjm2@ukc.ac.uk # # $Author: pjm2 $ -# $Id: ihost.pl,v 1.22 2001/03/01 10:49:27 pjm2 Exp $ +# $Id: ihost.pl,v 1.23 2001/03/01 18:53:42 pjm2 Exp $ #------------------------------------------------------------ $| = 1; @@ -304,7 +304,8 @@ sub send_tcp_heartbeat() { print $sock "HEARTBEAT\n"; $response = <$sock>; - chop $response or return; + return if (!defined $response); + chop $response; if (!$response eq "OK") { close($sock); print "Server gave wrong response to HEARTBEAT: $response\n"; @@ -313,7 +314,8 @@ sub send_tcp_heartbeat() { print $sock "CONFIG\n"; $response = <$sock>; - chop $response or return; + return if (!defined $response); + chop $response; if (!$response eq "OK") { close($sock); print "Server gave wrong response to CONFIG: $response\n"; @@ -322,7 +324,8 @@ sub send_tcp_heartbeat() { print $sock "$file_list\n"; $response = <$sock>; - chop $response or return; + return if (!defined $response); + chop $response; if (!$response eq "OK") { close($sock); print "Server gave wrong response to file list: $response\n"; @@ -331,7 +334,8 @@ sub send_tcp_heartbeat() { print $sock "$last_modified\n"; $response = <$sock>; - chop $response or return; + return if (!defined $response); + chop $response; if ($response eq "ERROR") { close($sock); &tcp_configure(); @@ -344,7 +348,8 @@ sub send_tcp_heartbeat() { } print $sock "ENDHEARTBEAT\n"; - $response = <$sock> or return; + $response = <$sock>; + return if (!defined $response); chop $response; if (!$response eq "OK") { close($sock);