void start(CURLM *a_curlm,CURLSH *a_curlsh,DnsCache *a_dns_cache) {
		state = kStarting;
		curlm = a_curlm;
		curlsh = a_curlsh;
		dns_cache = a_dns_cache;
		start_resolve();
	}
示例#2
0
void IPResolver::resolve_ready()
{
    if (queue.empty()) return;
    string m_host;
    if (resolver->hostNames().count())
        m_host = resolver->hostNames().first().latin1();
    struct in_addr inaddr;
    inaddr.s_addr = m_addr;
    log(L_DEBUG, "Resolver ready %s %s", inet_ntoa(inaddr), m_host.c_str());
#if COMPAT_QT_VERSION >= 0x030000
    delete resolver;
    resolver = NULL;
#endif
    for (list<IP*>::iterator it = queue.begin(); it != queue.end(); ){
        if ((*it)->ip() != m_addr){
            ++it;
            continue;
        }
        (*it)->set((*it)->ip(), m_host.c_str());
        queue.erase(it);
        it = queue.begin();
    }
    start_resolve();
}