forked fromAsyncHttpClient/async-http-client
- Notifications
You must be signed in to change notification settings - Fork0
Commit549fb25
committed
Disable IPv6 address lookups when -Djava.net.preferIPv4Stack=true,closeAsyncHttpClient#1336
Motivation:According to the Oracle documentation:> java.net.preferIPv4Stack (default: false)>> If IPv6 is available on the operating system, the underlying native> socket will be an IPv6 socket. This allows Java applications toconnect> to, and accept connections from, both IPv4 and IPv6 hosts.>> If an application has a preference to only use IPv4 sockets, then this> property can be set to true. The implication is that the application> will not be able to communicate with IPv6 hosts.which means, if DnsNameResolver returns an IPv6 address, a user (orNetty) will not be able to connect to it.Modifications:- Move the code that retrieves java.net.prefer* properties from DnsNameResolver to NetUtil- Add NetUtil.isIpV6AddressesPreferred()- Revise the API documentation of NetUtil.isIpV*Preferred()- Set the default resolveAddressTypes to IPv4 only when NetUtil.isIpv4StackPreferred() returns trueResult:-FixesAsyncHttpClient#13361 parent2fd2d86 commit549fb25
File tree
2 files changed
+1111
-14
lines changed- netty-bp/resolver-dns/src/main/java/io/netty
- resolver/dns
- util
2 files changed
+1111
-14
lines changedLines changed: 17 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
82 | 79 | | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
87 | 90 | | |
88 | 91 | | |
89 | 92 | | |
| |||
343 | 346 | | |
344 | 347 | | |
345 | 348 | | |
346 | | - | |
| 349 | + | |
347 | 350 | | |
348 | 351 | | |
349 | 352 | | |
| |||
461 | 464 | | |
462 | 465 | | |
463 | 466 | | |
464 | | - | |
| 467 | + | |
465 | 468 | | |
466 | 469 | | |
467 | 470 | | |
| |||
0 commit comments
Comments
(0)