MCPcopy Index your code
hub / github.com/nodejs/node / writeRequests

Function writeRequests

test/parallel/test-http2-reset-flood.js:64–78  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

62 let streamId = 1;
63
64 function writeRequests() {
65 for (let i = 1; i < 10 && !gotError; i++) {
66 h2header[3] = 1; // HEADERS
67 h2header[4] = 0x5; // END_HEADERS|END_STREAM
68 h2header.writeIntBE(1, 0, 3); // Length: 1
69 h2header.writeIntBE(streamId, 5, 4); // Stream ID
70 streamId += 2;
71 // 0x88 = :status: 200
72 if (!conn.write(Buffer.concat([h2header, Buffer.from([0x88])]))) {
73 break;
74 }
75 }
76 if (!gotError)
77 setImmediate(writeRequests);
78 }
79
80 conn.once('error', common.mustCall(() => {
81 gotError = true;

Callers 1

Calls 4

concatMethod · 0.80
setImmediateFunction · 0.50
writeMethod · 0.45
fromMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…