Commit da48083
committed
http: attach error handler to socket synchronously in onSocket
Between onSocket and onSocketNT, the socket had no error handler,
meaning any errors emitted during that window (e.g. from a blocklist
check or custom lookup) would be unhandled even if the user had set up
a request error handler.
Fix this by attaching socketErrorListener synchronously in onSocket,
setting socket._httpMessage so the listener can forward errors to the
request. The _destroy path in onSocketNT is also guarded to prevent
double-firing if socketErrorListener already emitted the error.
Fixes: #48771
Refs: #616581 parent 04946a7 commit da48083
File tree
2 files changed
+16
-8
lines changed- lib
- test/parallel
2 files changed
+16
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
571 | 571 | | |
572 | 572 | | |
573 | 573 | | |
574 | | - | |
| 574 | + | |
575 | 575 | | |
576 | 576 | | |
577 | 577 | | |
| |||
906 | 906 | | |
907 | 907 | | |
908 | 908 | | |
909 | | - | |
910 | 909 | | |
911 | 910 | | |
912 | 911 | | |
| |||
945 | 944 | | |
946 | 945 | | |
947 | 946 | | |
948 | | - | |
949 | | - | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
950 | 956 | | |
951 | 957 | | |
952 | 958 | | |
| |||
958 | 964 | | |
959 | 965 | | |
960 | 966 | | |
961 | | - | |
962 | | - | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
963 | 971 | | |
964 | 972 | | |
965 | 973 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
| 16 | + | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
0 commit comments