Commit 8407086
zlib: allow writes after readable 'end' to finish
Call the callback for writes that occur after the stream is closed.
This also requires changes to the code to not call `.destroy()`
on the stream in `.on('end')`, and to ignore chunks written
afterwards.
Previously, these writes would just queue up silently, as their
`_write()` callback would never have been called.
Fixes: #30976
PR-URL: #31082
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>1 parent 4cd459c commit 8407086Copy full SHA for 8407086
File tree
Expand file treeCollapse file tree
2 files changed
+21
-8
lines changedOpen diff view settings
Filter options
- lib
- test/parallel
Expand file treeCollapse file tree
2 files changed
+21
-8
lines changedOpen diff view settings
Collapse file
+5-8Lines changed: 5 additions & 8 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
264 | 264 | |
265 | 265 | |
266 | 266 | |
267 | | - |
| 267 | + |
268 | 268 | |
269 | 269 | |
270 | 270 | |
| ||
476 | 476 | |
477 | 477 | |
478 | 478 | |
479 | | - |
| 479 | + |
480 | 480 | |
481 | 481 | |
482 | 482 | |
| ||
502 | 502 | |
503 | 503 | |
504 | 504 | |
505 | | - |
506 | | - |
507 | | - |
508 | | - |
509 | | - |
510 | | - |
| 505 | + |
511 | 506 | |
| 507 | + |
512 | 508 | |
513 | 509 | |
514 | 510 | |
| ||
528 | 524 | |
529 | 525 | |
530 | 526 | |
| 527 | + |
531 | 528 | |
532 | 529 | |
533 | 530 | |
|
Collapse file
test/parallel/test-zlib-write-after-end.js
Copy file name to clipboard+16Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + |
0 commit comments