0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00

test: make test-tls-invoke-queued use public API

`parallel/test-tls-invoke-queued` previously used the internal
`_write()` API to hook into the internals more directly, but this
invalidates the general assumption made by streams APIs that
only a single write is active at a time, and which is enforced
through the public API.

PR-URL: https://github.com/nodejs/node/pull/17864
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Weijia Wang <starkwang@126.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Anna Henningsen 2017-12-25 21:38:10 +01:00
parent 83e5215a4e
commit 24c71fb47c
No known key found for this signature in database
GPG Key ID: 9C63F3A6CD2AD8F9

View File

@ -36,12 +36,12 @@ const server = tls.createServer({
key: fixtures.readKey('agent1-key.pem'),
cert: fixtures.readKey('agent1-cert.pem')
}, common.mustCall(function(c) {
c._write('hello ', null, common.mustCall(function() {
c._write('world!', null, common.mustCall(function() {
c.write('hello ', null, common.mustCall(function() {
c.write('world!', null, common.mustCall(function() {
c.destroy();
}));
// Data on next _write() will be written but callback will not be invoked
c._write(' gosh', null, common.mustNotCall());
c.write(' gosh', null, common.mustNotCall());
}));
server.close();