mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-15 17:37:12 -05:00
suppressed debug info, added lock
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3983 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
6d44694c7a
commit
e57f8836e4
@ -54,21 +54,25 @@ void *solveDNSEntries(void *p)
|
||||
break ;
|
||||
}
|
||||
}
|
||||
else
|
||||
return NULL; // the thread has been deleted. Return.
|
||||
}
|
||||
|
||||
if(!next_call.empty())
|
||||
{
|
||||
hostent *pHost = gethostbyname(next_call.c_str());
|
||||
|
||||
if(pHost)
|
||||
{
|
||||
RsStackMutex mut(dnsr->_rdnsMtx) ;
|
||||
|
||||
(*dnsr->_addr_map)[next_call].state = DNSResolver::DNS_HAVE ;
|
||||
(*dnsr->_addr_map)[next_call].addr.s_addr = *(unsigned long*) (pHost->h_addr);
|
||||
if(pHost)
|
||||
{
|
||||
(*dnsr->_addr_map)[next_call].state = DNSResolver::DNS_HAVE ;
|
||||
(*dnsr->_addr_map)[next_call].addr.s_addr = *(unsigned long*) (pHost->h_addr);
|
||||
}
|
||||
else
|
||||
(*dnsr->_addr_map)[next_call].state = DNSResolver::DNS_LOOKUP_ERROR ;
|
||||
}
|
||||
else
|
||||
(*dnsr->_addr_map)[next_call].state = DNSResolver::DNS_LOOKUP_ERROR ;
|
||||
}
|
||||
}
|
||||
|
||||
@ -98,6 +102,7 @@ void DNSResolver::reset()
|
||||
|
||||
*_thread_running = false ;
|
||||
_addr_map->clear();
|
||||
_addr_map = NULL ;
|
||||
}
|
||||
|
||||
bool DNSResolver::getIPAddressFromString(const std::string& server_name,struct in_addr& addr)
|
||||
@ -135,10 +140,7 @@ bool DNSResolver::getIPAddressFromString(const std::string& server_name,struct i
|
||||
}
|
||||
|
||||
if(!running)
|
||||
{
|
||||
std::cerr << "Launching reuqest!!"<< std::endl;
|
||||
start_request();
|
||||
}
|
||||
|
||||
return false ;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user