[Opensrf-commits] r2115 - branches/rel_1_6/src/perl/lib/OpenSRF/Transport/SlimJabber (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Nov 29 14:20:13 EST 2010
Author: erickson
Date: 2010-11-29 14:20:09 -0500 (Mon, 29 Nov 2010)
New Revision: 2115
Modified:
branches/rel_1_6/src/perl/lib/OpenSRF/Transport/SlimJabber/XMPPReader.pm
Log:
avoid calling sysread when select exited from interruption.
Modified: branches/rel_1_6/src/perl/lib/OpenSRF/Transport/SlimJabber/XMPPReader.pm
===================================================================
--- branches/rel_1_6/src/perl/lib/OpenSRF/Transport/SlimJabber/XMPPReader.pm 2010-11-29 19:19:02 UTC (rev 2114)
+++ branches/rel_1_6/src/perl/lib/OpenSRF/Transport/SlimJabber/XMPPReader.pm 2010-11-29 19:20:09 UTC (rev 2115)
@@ -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