ladjs / superagent

Ajax for Node.js and browsers (JS HTTP client). Maintained for @forwardemail, @ladjs, @spamscanner, @breejs, @cabinjs, and @lassjs.
https://ladjs.github.io/superagent/
MIT License
16.56k stars 1.33k forks source link

`drain` once is not good #1740

Open ulisesbocchio opened 1 year ago

ulisesbocchio commented 1 year ago

this PR to address #1084 changed the re-emitter of drain to once... which is not good. Piping a large stream into a request hangs indefinitely because request only drains once. Listener should be on and cleaned up after close is emitted. https://github.com/visionmedia/superagent/blob/29fd1f917a6cc78c9a2a9984269c06f8b4e63dcb/src/node/index.js#L821-L823