Commit 08d2e40
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: #61658
PR-URL: #61770
Refs: #48771
Reviewed-By: Tim Perry <pimterry@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>1 parent 460f412 commit 08d2e40Copy full SHA for 08d2e40
3 files changed
+21-21Lines changed: 21 additions & 21 deletions
File tree
Expand file treeCollapse file tree
Open diff view settings
Filter options
- lib
- test/parallel
Expand file treeCollapse file tree
Open diff view settings
Collapse file
+14-6Lines changed: 14 additions & 6 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
571 | 571 | |
572 | 572 | |
573 | 573 | |
574 | | - |
| 574 | + |
575 | 575 | |
576 | 576 | |
577 | 577 | |
| ||
910 | 910 | |
911 | 911 | |
912 | 912 | |
913 | | - |
914 | 913 | |
915 | 914 | |
916 | 915 | |
| ||
949 | 948 | |
950 | 949 | |
951 | 950 | |
952 | | - |
953 | | - |
| 951 | + |
| 952 | + |
| 953 | + |
| 954 | + |
| 955 | + |
| 956 | + |
| 957 | + |
| 958 | + |
| 959 | + |
954 | 960 | |
955 | 961 | |
956 | 962 | |
| ||
962 | 968 | |
963 | 969 | |
964 | 970 | |
965 | | - |
966 | | - |
| 971 | + |
| 972 | + |
| 973 | + |
| 974 | + |
967 | 975 | |
968 | 976 | |
969 | 977 | |
|
Collapse file
+5-13Lines changed: 5 additions & 13 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1125 | 1125 | |
1126 | 1126 | |
1127 | 1127 | |
1128 | | - |
| 1128 | + |
1129 | 1129 | |
1130 | 1130 | |
1131 | 1131 | |
| ||
1135 | 1135 | |
1136 | 1136 | |
1137 | 1137 | |
1138 | | - |
| 1138 | + |
1139 | 1139 | |
1140 | 1140 | |
1141 | 1141 | |
| ||
1167 | 1167 | |
1168 | 1168 | |
1169 | 1169 | |
1170 | | - |
| 1170 | + |
1171 | 1171 | |
1172 | 1172 | |
1173 | 1173 | |
1174 | 1174 | |
1175 | 1175 | |
1176 | | - |
1177 | | - |
1178 | | - |
1179 | | - |
1180 | | - |
1181 | | - |
1182 | | - |
1183 | | - |
1184 | 1176 | |
1185 | 1177 | |
1186 | 1178 | |
| ||
1194 | 1186 | |
1195 | 1187 | |
1196 | 1188 | |
1197 | | - |
| 1189 | + |
1198 | 1190 | |
1199 | 1191 | |
1200 | 1192 | |
1201 | | - |
| 1193 | + |
1202 | 1194 | |
1203 | 1195 | |
1204 | 1196 | |
|
Collapse file
test/parallel/test-http-request-lookup-error-catchable.js
Copy file name to clipboardExpand all lines: test/parallel/test-http-request-lookup-error-catchable.js+2-2Lines changed: 2 additions & 2 deletions
| 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