Merge branch 'master' into epoll_changes

This commit is contained in:
Sree Kuchibhotla 2016-06-23 09:23:01 -07:00
commit 6ed5904a9d
1 changed files with 1 additions and 12 deletions

View File

@ -45,9 +45,6 @@ var testProto = grpc.load({
var ECHO_INITIAL_KEY = 'x-grpc-test-echo-initial'; var ECHO_INITIAL_KEY = 'x-grpc-test-echo-initial';
var ECHO_TRAILING_KEY = 'x-grpc-test-echo-trailing-bin'; var ECHO_TRAILING_KEY = 'x-grpc-test-echo-trailing-bin';
var incompressible_data = fs.readFileSync(
__dirname + '/../../../test/cpp/interop/rnd.dat');
/** /**
* Create a buffer filled with size zeroes * Create a buffer filled with size zeroes
* @param {number} size The length of the buffer * @param {number} size The length of the buffer
@ -88,15 +85,7 @@ function getEchoTrailer(call) {
} }
function getPayload(payload_type, size) { function getPayload(payload_type, size) {
if (payload_type === 'RANDOM') { var body = zeroBuffer(size);
payload_type = ['COMPRESSABLE',
'UNCOMPRESSABLE'][Math.random() < 0.5 ? 0 : 1];
}
var body;
switch (payload_type) {
case 'COMPRESSABLE': body = zeroBuffer(size); break;
case 'UNCOMPRESSABLE': incompressible_data.slice(size); break;
}
return {type: payload_type, body: body}; return {type: payload_type, body: body};
} }