From bf88e7052f402bb867accd093a63d514be276b49 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Tue, 1 May 2012 20:02:06 +0000 Subject: [PATCH] Correct problem where xcatd could truncate very large responses git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@12430 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/sbin/xcatd | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/xCAT-server/sbin/xcatd b/xCAT-server/sbin/xcatd index c593b6f5f..92d1995cb 100755 --- a/xCAT-server/sbin/xcatd +++ b/xCAT-server/sbin/xcatd @@ -1841,7 +1841,14 @@ sub send_pending_responses { $resp =~ tr/\011-\177/?/c; #seeing if using utf-8 offloads potential issues to client terminal, it didn't eval { - print $sock $resp; + my $rsplen = length($resp); + my $blocks = int($rsplen/4096)-1; + if ($rsplen%4096) { + $blocks += 1; + } + foreach (0..$blocks) { + syswrite($sock,$resp,4096,$_*4096); + } }; } sub relay_fds { #Relays file descriptors from pipes to children to the SSL socket