[Opensrf-commits] r2110 - trunk/src/perl/lib/OpenSRF/Transport/SlimJabber (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Nov 29 14:16:38 EST 2010
Author: erickson
Date: 2010-11-29 14:16:34 -0500 (Mon, 29 Nov 2010)
New Revision: 2110
Modified:
trunk/src/perl/lib/OpenSRF/Transport/SlimJabber/XMPPReader.pm
Log:
avoid calling sysread when select exited from interruption.
Modified: trunk/src/perl/lib/OpenSRF/Transport/SlimJabber/XMPPReader.pm
===================================================================
--- trunk/src/perl/lib/OpenSRF/Transport/SlimJabber/XMPPReader.pm 2010-11-29 19:15:07 UTC (rev 2109)
+++ trunk/src/perl/lib/OpenSRF/Transport/SlimJabber/XMPPReader.pm 2010-11-29 19:16:34 UTC (rev 2110)
@@ -203,12 +203,15 @@
# build the select readset
my $infile = '';
vec($infile, $socket->fileno, 1) = 1;
- return undef unless select($infile, undef, undef, $timeout);
+ my $nfound = select($infile, undef, undef, $timeout);
+ return undef if !$nfound or $nfound == -1;
+
# now slurp the data off the socket
my $buf;
my $read_size = 1024;
my $nonblock = 0;
+
while(my $n = sysread($socket, $buf, $read_size)) {
$self->{parser}->parse_more($buf) if $buf;
if($n < $read_size or $self->peek_msg) {
More information about the opensrf-commits
mailing list