http: fix drain event with cork/uncork · nodejs/node@aeb539a · GitHub
Skip to content

Commit aeb539a

Browse files
davidje13richardlau
authored andcommitted
http: fix drain event with cork/uncork
When using cork() and uncork() with ServerResponse, the drain event was not reliably emitted after uncorking. This occurred because the uncork() method did not check if a drain was pending (kNeedDrain flag) after flushing the chunked buffer. This fix ensures that when uncork() successfully flushes buffered data and a drain was needed, the drain event is emitted immediately. This commit is a copy of PR #60437 (abandoned) with minor linting fixes. Fixes: #60432 Signed-off-by: David Evans <davidje13@users.noreply.github.com> PR-URL: #64038 Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Tim Perry <pimterry@gmail.com>
1 parent 92a3dc3 commit aeb539a

2 files changed

Lines changed: 70 additions & 0 deletions

File tree

lib/_http_outgoing.js

Lines changed: 6 additions & 0 deletions
Lines changed: 64 additions & 0 deletions

0 commit comments

Comments
 (0)