Commit 026f760
dns: fix crash while setting server during query
Fix this issue follow these two points:
1. Keep track of how many queries are currently open. If `setServers()`
is called while there are open queries, error out.
2. For `Resolver` instances, use option 1. For dns.setServers(), just
create a fresh new default channel every time it is called, and then
set its servers list.
PR-URL: #14891
Fixes: #14734
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>1 parent 619cbc4 commit 026f760Copy full SHA for 026f760
File tree
Expand file treeCollapse file tree
4 files changed
+94
-21
lines changedOpen diff view settings
Filter options
- lib
- src
- test
- internet
- parallel
Expand file treeCollapse file tree
4 files changed
+94
-21
lines changedOpen diff view settings
Collapse file
+34-16Lines changed: 34 additions & 16 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
380 | 380 | |
381 | 381 | |
382 | 382 | |
383 | | - |
| 383 | + |
| 384 | + |
| 385 | + |
| 386 | + |
| 387 | + |
| 388 | + |
| 389 | + |
| 390 | + |
| 391 | + |
| 392 | + |
| 393 | + |
| 394 | + |
| 395 | + |
| 396 | + |
| 397 | + |
| 398 | + |
| 399 | + |
| 400 | + |
| 401 | + |
| 402 | + |
| 403 | + |
| 404 | + |
| 405 | + |
| 406 | + |
| 407 | + |
| 408 | + |
| 409 | + |
| 410 | + |
| 411 | + |
| 412 | + |
| 413 | + |
384 | 414 | |
385 | 415 | |
386 | 416 | |
387 | 417 | |
388 | 418 | |
389 | 419 | |
390 | | - |
391 | | - |
392 | | - |
393 | | - |
394 | | - |
395 | | - |
396 | | - |
397 | | - |
398 | | - |
399 | | - |
400 | | - |
401 | | - |
402 | | - |
403 | | - |
404 | | - |
| 420 | + |
405 | 421 | |
406 | 422 | |
407 | 423 | |
| ||
433 | 449 | |
434 | 450 | |
435 | 451 | |
| 452 | + |
| 453 | + |
Collapse file
+26-5Lines changed: 26 additions & 5 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
83 | 83 | |
84 | 84 | |
85 | 85 | |
| 86 | + |
86 | 87 | |
87 | 88 | |
88 | 89 | |
| ||
150 | 151 | |
151 | 152 | |
152 | 153 | |
| 154 | + |
| 155 | + |
153 | 156 | |
154 | 157 | |
155 | 158 | |
| ||
158 | 161 | |
159 | 162 | |
160 | 163 | |
| 164 | + |
161 | 165 | |
162 | 166 | |
163 | 167 | |
| ||
170 | 174 | |
171 | 175 | |
172 | 176 | |
| 177 | + |
173 | 178 | |
174 | 179 | |
175 | 180 | |
| ||
180 | 185 | |
181 | 186 | |
182 | 187 | |
183 | | - |
| 188 | + |
| 189 | + |
184 | 190 | |
185 | 191 | |
186 | 192 | |
| ||
545 | 551 | |
546 | 552 | |
547 | 553 | |
| 554 | + |
| 555 | + |
| 556 | + |
| 557 | + |
| 558 | + |
548 | 559 | |
549 | 560 | |
550 | 561 | |
| ||
682 | 693 | |
683 | 694 | |
684 | 695 | |
| 696 | + |
685 | 697 | |
686 | 698 | |
687 | 699 | |
| ||
1802 | 1814 | |
1803 | 1815 | |
1804 | 1816 | |
| 1817 | + |
1805 | 1818 | |
1806 | | - |
| 1819 | + |
| 1820 | + |
1807 | 1821 | |
| 1822 | + |
1808 | 1823 | |
1809 | 1824 | |
1810 | 1825 | |
| ||
2081 | 2096 | |
2082 | 2097 | |
2083 | 2098 | |
| 2099 | + |
| 2100 | + |
| 2101 | + |
| 2102 | + |
2084 | 2103 | |
2085 | 2104 | |
2086 | 2105 | |
| ||
2161 | 2180 | |
2162 | 2181 | |
2163 | 2182 | |
2164 | | - |
| 2183 | + |
2165 | 2184 | |
2166 | 2185 | |
2167 | | - |
2168 | | - |
| 2186 | + |
| 2187 | + |
| 2188 | + |
| 2189 | + |
2169 | 2190 | |
2170 | 2191 | |
2171 | 2192 | |
|
Collapse file
test/internet/test-dns-setserver-in-callback-of-resolve4.js
Copy file name to clipboardExpand all lines: test/internet/test-dns-setserver-in-callback-of-resolve4.js+3Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
13 | 13 | |
14 | 14 | |
15 | 15 | |
| 16 | + |
| 17 | + |
| 18 | + |
Collapse file
test/parallel/test-dns-setserver-when-querying.js
Copy file name to clipboard+31Lines changed: 31 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 | + |
0 commit comments