mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
456 B
22 lines
456 B
8 years ago
|
'use strict';
|
||
|
|
||
|
const common = require('../common');
|
||
|
const zlib = require('zlib');
|
||
|
const { Writable } = require('stream');
|
||
|
|
||
|
// verify that the zlib transform does not error in case
|
||
|
// it is destroyed with data still in flight
|
||
|
|
||
|
const ts = zlib.createGzip();
|
||
|
|
||
|
const ws = new Writable({
|
||
|
write: common.mustCall((chunk, enc, cb) => {
|
||
|
setImmediate(cb);
|
||
|
ts.destroy();
|
||
|
})
|
||
|
});
|
||
|
|
||
|
const buf = Buffer.allocUnsafe(1024 * 1024 * 20);
|
||
|
ts.end(buf);
|
||
|
ts.pipe(ws);
|