From: Bill Erickson Date: Wed, 14 Mar 2012 15:38:18 +0000 (-0400) Subject: Prevent undef warnings on perl socket read nbytes test X-Git-Tag: osrf_rel_2_1_0-rc1~2 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=cf4d4798c5949abaf6bc9a4c3a62bf9a6533977b;p=OpenSRF.git Prevent undef warnings on perl socket read nbytes test Signed-off-by: Bill Erickson Signed-off-by: Dan Scott --- diff --git a/src/perl/lib/OpenSRF/Transport/SlimJabber/XMPPReader.pm b/src/perl/lib/OpenSRF/Transport/SlimJabber/XMPPReader.pm index b8a5da1..b68e418 100644 --- a/src/perl/lib/OpenSRF/Transport/SlimJabber/XMPPReader.pm +++ b/src/perl/lib/OpenSRF/Transport/SlimJabber/XMPPReader.pm @@ -226,7 +226,7 @@ sub wait { $first_read = 0; } - if ($nbytes == 0 and $first_read) { + if ($first_read and defined $nbytes and $nbytes == 0) { # if the first read on an active socket is 0 bytes, # the socket has been disconnected from the remote end. $logger->error("Disconnected from Jabber server");