Commit 687c0ac
http2: fix FileHandle leak in respondWithFile
Ensure that the file handle is closed if header validation fails in
respondWithFile. This prevents ERR_INVALID_STATE errors where a
FileHandle object is closed during garbage collection.
PR-URL: #61707
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Tim Perry <pimterry@gmail.com>1 parent ae5e353 commit 687c0acCopy full SHA for 687c0ac
2 files changed
+55Lines changed: 55 additions & 0 deletions
File tree
Expand file treeCollapse file tree
Open diff view settings
Filter options
- lib/internal/http2
- test/parallel
Expand file treeCollapse file tree
Open diff view settings
Collapse file
+4Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
2680 | 2680 | |
2681 | 2681 | |
2682 | 2682 | |
| 2683 | + |
| 2684 | + |
2683 | 2685 | |
2684 | 2686 | |
2685 | 2687 | |
| ||
2693 | 2695 | |
2694 | 2696 | |
2695 | 2697 | |
| 2698 | + |
| 2699 | + |
2696 | 2700 | |
2697 | 2701 | |
2698 | 2702 | |
|
Collapse file
test/parallel/test-http2-respond-file-fd-leak.js
Copy file name to clipboard+51Lines changed: 51 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 | + |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | + |
| 40 | + |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | + |
| 50 | + |
| 51 | + |
0 commit comments