Skip to content

Commit 09277fa

Browse files
edsadrcodebytere
authored andcommitted
benchmark: fixing http_server_for_chunky_client.js
PR-URL: #33271 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent 6133639 commit 09277fa

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

benchmark/http/http_server_for_chunky_client.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ process.env.PIPE_NAME = PIPE;
1010

1111
tmpdir.refresh();
1212

13-
const server = http.createServer((req, res) => {
13+
// For Node.js versions below v13.3.0 this benchmark will require
14+
// the flag --max-http-header-size 64000 in order to work properly
15+
const server = http.createServer({ maxHeaderSize: 64000 }, (req, res) => {
1416
const headers = {
1517
'content-type': 'text/plain',
1618
'content-length': '2'
@@ -28,7 +30,11 @@ const child = fork(
2830
`${__dirname}/_chunky_http_client.js`,
2931
process.argv.slice(2)
3032
);
31-
child.on('message', common.sendResult);
33+
child.on('message', (data) => {
34+
if (data.type === 'report') {
35+
common.sendResult(data);
36+
}
37+
});
3238
child.on('close', (code) => {
3339
server.close();
3440
assert.strictEqual(code, 0);

0 commit comments

Comments
 (0)