MCPcopy Create free account
hub / github.com/aria2/aria2 / configureAsyncNameResolverMan

Function configureAsyncNameResolverMan

src/AsyncNameResolverMan.cc:207–225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

205}
206
207void configureAsyncNameResolverMan(AsyncNameResolverMan* asyncNameResolverMan,
208 Option* option)
209{
210 // Currently, aria2 checks configured addresses at the startup. But
211 // there are chances that interfaces are not setup at that
212 // moment. For example, if aria2 is used as daemon, it may start
213 // before network interfaces up. To workaround this, we check
214 // addresses again if both addresses are not configured at the
215 // startup.
216 if (!net::getIPv4AddrConfigured() && !net::getIPv6AddrConfigured()) {
217 net::checkAddrconfig();
218 }
219 if (!net::getIPv4AddrConfigured()) {
220 asyncNameResolverMan->setIPv4(false);
221 }
222 if (!net::getIPv6AddrConfigured() || option->getAsBool(PREF_DISABLE_IPV6)) {
223 asyncNameResolverMan->setIPv6(false);
224 }
225}
226
227} // namespace aria2

Callers 3

NameResolveCommandMethod · 0.85
AbstractCommandMethod · 0.85

Calls 6

getIPv4AddrConfiguredFunction · 0.85
getIPv6AddrConfiguredFunction · 0.85
checkAddrconfigFunction · 0.85
setIPv4Method · 0.80
getAsBoolMethod · 0.80
setIPv6Method · 0.80

Tested by

no test coverage detected