| 205 | } |
| 206 | |
| 207 | void 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 |
no test coverage detected