From 22e92e3c0502831b915467e446f1a0c08851df2d Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Thu, 30 May 2013 18:58:15 +0000 Subject: [PATCH] Try to doubly make sure that buffering and EGAIN doesn't interfere with communication git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@16481 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/sbin/xcatd | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/xCAT-server/sbin/xcatd b/xCAT-server/sbin/xcatd index 26c801466..84b193a8d 100755 --- a/xCAT-server/sbin/xcatd +++ b/xCAT-server/sbin/xcatd @@ -1055,6 +1055,9 @@ until ($quit) { } #we have a pending connection and we are under the threshold, grab one from the list and process it... my $cnnection=shift @pendingconnections; + my $previous = select ($cnnection); #assure that perl buffering is not in play at the low level + $|=1; + select ($previous); my $connection; my $child = xCAT::Utils->xfork(); #Yes we fork, IO::Socket::SSL is not threadsafe.. if ($child) { @@ -1099,6 +1102,9 @@ until ($quit) { unless ($connection) { xexit 0; } + $previous=select($connection); #also assure buffering not in play at SSL socket, which seems to be possibly independent of lower socket + $|=1; + select($previous); $clientselect->add($connection); my $peerhost=undef; my $peerfqdn=undef; @@ -2137,7 +2143,9 @@ sub send_pending_responses { $blocks += 1; } foreach (0..$blocks) { + do { syswrite($sock,$resp,4096,$_*4096); + } while ($! == EAGAIN); } }; }