[Opensrf-commits] r2113 - branches/rel_2_0/src/perl/lib/OpenSRF/Transport/SlimJabber (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Nov 29 14:18:45 EST 2010


Author: erickson
Date: 2010-11-29 14:18:41 -0500 (Mon, 29 Nov 2010)
New Revision: 2113

Modified:
   branches/rel_2_0/src/perl/lib/OpenSRF/Transport/SlimJabber/XMPPReader.pm
Log:
avoid calling sysread when select exited from interruption.

Modified: branches/rel_2_0/src/perl/lib/OpenSRF/Transport/SlimJabber/XMPPReader.pm
===================================================================
--- branches/rel_2_0/src/perl/lib/OpenSRF/Transport/SlimJabber/XMPPReader.pm	2010-11-29 19:18:33 UTC (rev 2112)
+++ branches/rel_2_0/src/perl/lib/OpenSRF/Transport/SlimJabber/XMPPReader.pm	2010-11-29 19:18:41 UTC (rev 2113)
@@ -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