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
This commit is contained in:
jbjohnso 2013-05-30 18:58:15 +00:00
parent d7ddcebef2
commit 22e92e3c05

View File

@ -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);
}
};
}