diff options
| author | Nagi5Yeq <wu@x-nagi.com> | 2021-02-05 16:27:05 +0800 |
|---|---|---|
| committer | Nagi5Yeq <wu@x-nagi.com> | 2021-02-05 16:27:05 +0800 |
| commit | ff92e2f4e0724db321c9cbeb34ab5d78ba1af036 (patch) | |
| tree | 6e473c39e705743340e3fcbee3df4c707e69dcf4 | |
| parent | 32ebcdbc8290474b63d78d357847eebea8cb9ad9 (diff) | |
sending ipv6 address is not necessary because the asynchronous resolution problem is fixedrearrange-args
| -rw-r--r-- | src/AsyncNameResolverMan.cc | 6 | ||||
| -rw-r--r-- | src/AsyncNameResolverMan.h | 4 | ||||
| -rw-r--r-- | src/DefaultBtAnnounce.cc | 5 | ||||
| -rw-r--r-- | src/SocketCore.cc | 16 | ||||
| -rw-r--r-- | src/SocketCore.h | 3 |
5 files changed, 5 insertions, 29 deletions
diff --git a/src/AsyncNameResolverMan.cc b/src/AsyncNameResolverMan.cc index d20296da..1d728e2e 100644 --- a/src/AsyncNameResolverMan.cc +++ b/src/AsyncNameResolverMan.cc @@ -53,7 +53,7 @@ AsyncNameResolverMan::AsyncNameResolverMan() resolverCheck_(0), ipv4_(true), ipv6_(true), - allowIpv6Only_(false) + allowIPv6Only_(false) { } @@ -171,7 +171,7 @@ int AsyncNameResolverMan::getStatus() const break; } } - if (allowIpv6Only_ == true) { + if (allowIPv6Only_ == true) { // The waiting process of IPv4 and IPv6 lookup will eventually timeout // the resolution of IPv6-only domains, so just report success regardless of // which address family the result belongs to in such case. @@ -236,7 +236,7 @@ void configureAsyncNameResolverMan(AsyncNameResolverMan* asyncNameResolverMan, if (!net::getIPv6AddrConfigured() || option->getAsBool(PREF_DISABLE_IPV6)) { asyncNameResolverMan->setIPv6(false); } - asyncNameResolverMan->setAllowIpv6Only( + asyncNameResolverMan->setAllowIPv6Only( option->getAsBool(PERF_ASYNC_DNS_ALLOW_IPV6ONLY)); } diff --git a/src/AsyncNameResolverMan.h b/src/AsyncNameResolverMan.h index 1acd3cc6..22542364 100644 --- a/src/AsyncNameResolverMan.h +++ b/src/AsyncNameResolverMan.h @@ -59,7 +59,7 @@ public: // Enable IPv6 address lookup. default: true void setIPv6(bool ipv6) { ipv6_ = ipv6; } // Allow resolver returning only ipv6 address. default: false - void setAllowIpv6Only(bool allow) { allowIpv6Only_ = allow; } + void setAllowIPv6Only(bool allow) { allowIPv6Only_ = allow; } // Returns true if asynchronous name resolution has been started. bool started() const; // Starts asynchronous name resolution. @@ -94,7 +94,7 @@ private: int resolverCheck_; bool ipv4_; bool ipv6_; - bool allowIpv6Only_; + bool allowIPv6Only_; }; void configureAsyncNameResolverMan(AsyncNameResolverMan* asyncNameResolverMan, diff --git a/src/DefaultBtAnnounce.cc b/src/DefaultBtAnnounce.cc index 17daa390..9f684bff 100644 --- a/src/DefaultBtAnnounce.cc +++ b/src/DefaultBtAnnounce.cc @@ -198,11 +198,6 @@ std::string DefaultBtAnnounce::getAnnounceUrl() uri += "&ip="; uri += option_->get(PREF_BT_EXTERNAL_IP); } - const char* globalIpv6Addr = net::getGlobalIpv6Addr(); - if (globalIpv6Addr != nullptr) { - uri += "&ipv6="; - uri += globalIpv6Addr; - } return uri; } diff --git a/src/SocketCore.cc b/src/SocketCore.cc index b82ba0b3..e235f512 100644 --- a/src/SocketCore.cc +++ b/src/SocketCore.cc @@ -1570,9 +1570,6 @@ bool verifyHostname(const std::string& hostname, namespace { bool ipv4AddrConfigured = true; bool ipv6AddrConfigured = true; - -bool hasGlobalIpv6Addr = false; -char globalIpv6Addr[NI_MAXHOST]; } // namespace #ifdef __MINGW32__ @@ -1697,11 +1694,6 @@ void checkAddrconfig() !IN6_IS_ADDR_LINKLOCAL(&ad.in6.sin6_addr)) { ipv6AddrConfigured = true; found = true; - if (!hasGlobalIpv6Addr && - inetNtop(AF_INET6, &ad.in6.sin6_addr, globalIpv6Addr, - sizeof(globalIpv6Addr)) == 0) { - hasGlobalIpv6Addr = true; - } } break; } @@ -1731,14 +1723,6 @@ bool getIPv4AddrConfigured() { return ipv4AddrConfigured; } bool getIPv6AddrConfigured() { return ipv6AddrConfigured; } -const char* getGlobalIpv6Addr() -{ - if (hasGlobalIpv6Addr == true) { - return globalIpv6Addr; - } - return nullptr; -} - } // namespace net } // namespace aria2 diff --git a/src/SocketCore.h b/src/SocketCore.h index 38cb3a95..60f33279 100644 --- a/src/SocketCore.h +++ b/src/SocketCore.h @@ -425,9 +425,6 @@ void checkAddrconfig(); bool getIPv4AddrConfigured(); bool getIPv6AddrConfigured(); -// Returns a unicast ipv6 address or NULL if not exist. Used for announce. -const char* getGlobalIpv6Addr(); - } // namespace net } // namespace aria2 |
