summaryrefslogtreecommitdiff
path: root/test/parallel/test-http2-reset-flood.js
diff options
context:
space:
mode:
authorRobert Nagy <ronagy@icloud.com>2019-08-24 16:33:46 +0200
committerRich Trott <rtrott@gmail.com>2019-09-30 10:56:29 -0700
commitf663b31cc2aecd585e73430504f3d7f5252851ca (patch)
treeb727bf953711f9f83fa9b7dca13e30f07d17d694 /test/parallel/test-http2-reset-flood.js
parent634a9a97f4b380390352543452aed6c7c9defcb4 (diff)
downloadandroid-node-v8-f663b31cc2aecd585e73430504f3d7f5252851ca.tar.gz
android-node-v8-f663b31cc2aecd585e73430504f3d7f5252851ca.tar.bz2
android-node-v8-f663b31cc2aecd585e73430504f3d7f5252851ca.zip
stream: always invoke callback before emitting error
Ensure the callback is always invoked before emitting the error in both sync and async case. PR-URL: https://github.com/nodejs/node/pull/29293 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'test/parallel/test-http2-reset-flood.js')
-rw-r--r--test/parallel/test-http2-reset-flood.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/parallel/test-http2-reset-flood.js b/test/parallel/test-http2-reset-flood.js
index a6553401fb..9977bfd1a3 100644
--- a/test/parallel/test-http2-reset-flood.js
+++ b/test/parallel/test-http2-reset-flood.js
@@ -67,7 +67,10 @@ const worker = new Worker(__filename).on('message', common.mustCall((port) => {
h2header.writeIntBE(1, 0, 3); // Length: 1
h2header.writeIntBE(i, 5, 4); // Stream ID
// 0x88 = :status: 200
- conn.write(Buffer.concat([h2header, Buffer.from([0x88])]));
+ if (!conn.write(Buffer.concat([h2header, Buffer.from([0x88])]))) {
+ process.nextTick(writeRequests);
+ break;
+ }
}
}