updated node interop server

pull/6839/head
David Garcia Quintas 9 years ago
parent dacce7a1e1
commit e89aad02bf
  1. 13
      src/node/interop/interop_server.js

@ -45,9 +45,6 @@ var testProto = grpc.load({
var ECHO_INITIAL_KEY = 'x-grpc-test-echo-initial';
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
* @param {number} size The length of the buffer
@ -88,15 +85,7 @@ function getEchoTrailer(call) {
}
function getPayload(payload_type, size) {
if (payload_type === 'RANDOM') {
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;
}
var body = zeroBuffer(size);
return {type: payload_type, body: body};
}

Loading…
Cancel
Save