Commit 3ad584c
net: handle socket.write(cb) edge case
Make sure that when calling `write()` on a connecting socket, the
callback is called if the socket is destroyed before the connection is
established.
Fixes: #30841
PR-URL: #45922
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>1 parent 782b6f6 commit 3ad584cCopy full SHA for 3ad584c
File tree
Expand file treeCollapse file tree
4 files changed
+43
-0
lines changedOpen diff view settings
Filter options
- doc/api
- lib
- internal
- test/parallel
Expand file treeCollapse file tree
4 files changed
+43
-0
lines changedOpen diff view settings
Collapse file
+8Lines changed: 8 additions & 0 deletions
- Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
2565 | 2565 | |
2566 | 2566 | |
2567 | 2567 | |
| 2568 | + |
| 2569 | + |
| 2570 | + |
| 2571 | + |
| 2572 | + |
| 2573 | + |
| 2574 | + |
2568 | 2575 | |
2569 | 2576 | |
2570 | 2577 | |
| ||
3576 | 3583 | |
3577 | 3584 | |
3578 | 3585 | |
| 3586 | + |
3579 | 3587 | |
3580 | 3588 | |
3581 | 3589 | |
|
Collapse file
+3Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1566 | 1566 | |
1567 | 1567 | |
1568 | 1568 | |
| 1569 | + |
| 1570 | + |
| 1571 | + |
1569 | 1572 | |
1570 | 1573 | |
1571 | 1574 | |
|
Collapse file
+6Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
98 | 98 | |
99 | 99 | |
100 | 100 | |
| 101 | + |
101 | 102 | |
102 | 103 | |
103 | 104 | |
| ||
903 | 904 | |
904 | 905 | |
905 | 906 | |
| 907 | + |
906 | 908 | |
907 | 909 | |
| 910 | + |
| 911 | + |
| 912 | + |
| 913 | + |
908 | 914 | |
909 | 915 | |
910 | 916 | |
|
Collapse file
test/parallel/test-net-write-cb-on-destroy-before-connect.js
Copy file name to clipboard+26Lines changed: 26 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 | + |
0 commit comments