mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-25 23:00:56 -04:00
made the DNS calls in a separate thread, using new DNSResolver class. Added test program for that class as well. Moved extaddrfinder to util/
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3980 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
dddc9c383c
commit
40f4009ca7
10 changed files with 328 additions and 53 deletions
libretroshare/src/util
|
@ -129,22 +129,6 @@ bool isExternalNet(const struct in_addr *addr)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool getIPAddressFromString (const char *addr_str, struct in_addr *addr)
|
||||
{
|
||||
if (addr_str && addr) {
|
||||
static RsMutex mtx;
|
||||
RsStackMutex stack(mtx);
|
||||
|
||||
hostent *pHost = gethostbyname (addr_str);
|
||||
if (pHost) {
|
||||
addr->s_addr = *(unsigned long*) (pHost->h_addr);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
std::ostream &operator<<(std::ostream &out, const struct sockaddr_in &addr)
|
||||
{
|
||||
out << "[" << inet_ntoa(addr.sin_addr) << ":";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue