2017-08-10 22:00:01 +00:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const common = require('../common');
|
|
|
|
if (!common.hasCrypto)
|
|
|
|
common.skip('missing crypto');
|
|
|
|
const assert = require('assert');
|
|
|
|
const http2 = require('http2');
|
|
|
|
const util = require('util');
|
|
|
|
|
|
|
|
const server = http2.createServer();
|
|
|
|
server.on('stream', common.mustCall((stream) => {
|
|
|
|
assert.strictEqual(stream.aborted, false);
|
|
|
|
const insp = util.inspect(stream);
|
2021-08-29 08:14:22 +00:00
|
|
|
assert.match(insp, /Http2Stream {/);
|
2022-01-09 16:45:19 +00:00
|
|
|
assert.match(insp, / {2}state:/);
|
|
|
|
assert.match(insp, / {2}readableState:/);
|
|
|
|
assert.match(insp, / {2}writableState:/);
|
2017-08-10 22:00:01 +00:00
|
|
|
stream.end('ok');
|
|
|
|
}));
|
|
|
|
server.listen(0, common.mustCall(() => {
|
|
|
|
const client = http2.connect(`http://localhost:${server.address().port}`);
|
|
|
|
const req = client.request();
|
|
|
|
req.resume();
|
2017-11-25 21:02:16 +00:00
|
|
|
req.on('close', common.mustCall(() => {
|
2017-12-12 19:34:17 +00:00
|
|
|
client.close();
|
2017-08-10 22:00:01 +00:00
|
|
|
server.close();
|
|
|
|
}));
|
|
|
|
}));
|