Remove die on recv

This commit is contained in:
Ben Peddell 2015-12-28 10:21:39 +10:00
parent 5e55fcb0e4
commit 9d45d9d1cc

View File

@ -271,7 +271,7 @@ rconcmd() {
sub recvpkt {
my ($sock) = @_;
my $data = "";
recv($sock, $data, 12, 0) or die "Error receiving response from server: $!";
recv($sock, $data, 12, 0);
die "Empty response" if len($data) == 0;
my ($pktlen, $resid, $restype) = unpack("VVV", $data);
recv($sock, $data, $pktlen - 8, 0);