Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
benchmark: fixing http_server_for_chunky_client.js
  • Loading branch information
edsadr committed May 6, 2020
commit 080800c690a00afb1153aa074a58385441dd4257
10 changes: 8 additions & 2 deletions benchmark/http/http_server_for_chunky_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ process.env.PIPE_NAME = PIPE;

tmpdir.refresh();

const server = http.createServer((req, res) => {
// For Node.js versions below v13.3.0 this benchmark will require
// the flag --max-http-header-size 64000 in order to work properly
const server = http.createServer({ maxHeaderSize: 64000 }, (req, res) => {
const headers = {
'content-type': 'text/plain',
'content-length': '2'
Expand All @@ -28,7 +30,11 @@ const child = fork(
`${__dirname}/_chunky_http_client.js`,
process.argv.slice(2)
);
child.on('message', common.sendResult);
child.on('message', (data) => {
if (data.type === 'report') {
common.sendResult(data);
}
});
child.on('close', (code) => {
server.close();
assert.strictEqual(code, 0);
Expand Down