Closed
Description
Running this will cause the memory usage of the node process to infinitly grow...
- Version: 10.13.0
- Platform: OSX
- Subsystem:
const http = require('http')
const { spawn } = require('child_process')
const crypto = require('crypto')
const fs = require('fs')
const dst = fs.createWriteStream('./tmp')
http.createServer((req, res) => {
req
.on('data', buf => {
if (!dst.write(buf)) {
req.pause()
}
})
dst.on('drain', () => {
if (req.readable) {
req.resume()
}
})
}).listen(9988, () => {
spawn('cat', ['/dev/zero'])
.stdout
.pipe(http
.request({
hostname: 'localhost',
port: 9988,
path: `/file`,
method: 'POST'
})
)
})