mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 14:16:16 -04:00
merged upstream/master
This commit is contained in:
commit
cecd9a3368
136 changed files with 5050 additions and 2182 deletions
|
@ -93,9 +93,9 @@ again:
|
|||
idx = (idx + 1) % 4;
|
||||
}
|
||||
|
||||
idx = idx;
|
||||
//idx = idx;
|
||||
|
||||
return buf;
|
||||
return buf ;
|
||||
}
|
||||
|
||||
/****************
|
||||
|
@ -147,7 +147,7 @@ again:
|
|||
|
||||
private:
|
||||
static inline char *bintoasc() { static char bta[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; return bta ; }
|
||||
static inline char *asctobin() { static char s[256]; return s ; } /* runtime radix64_initd */
|
||||
static inline uint8_t *asctobin() { static uint8_t s[256]; return s ; } /* runtime radix64_initd */
|
||||
static int& is_radix64_initd() { static int is_inited = false ; return is_inited ; }
|
||||
|
||||
/* hey, guess what: this is a read-only table.
|
||||
|
|
|
@ -81,15 +81,18 @@ bool rsGetHostByName(const std::string& hostname, in_addr& returned_addr)
|
|||
addrinfo *info = NULL;
|
||||
int res = getaddrinfo(hostname.c_str(),NULL,NULL,&info) ;
|
||||
|
||||
bool ok = true;
|
||||
if(res > 0 || info == NULL || info->ai_addr == NULL)
|
||||
{
|
||||
std::cerr << "(EE) getaddrinfo returned error " << res << " on string \"" << hostname << "\"" << std::endl;
|
||||
returned_addr.s_addr = 0 ;
|
||||
ok = false;
|
||||
}
|
||||
else
|
||||
returned_addr.s_addr = ((sockaddr_in*)info->ai_addr)->sin_addr.s_addr ;
|
||||
|
||||
freeaddrinfo(info) ;
|
||||
if(info)
|
||||
freeaddrinfo(info) ;
|
||||
|
||||
#ifdef DEPRECATED_TO_REMOVE
|
||||
#if defined(WINDOWS_SYS) || defined(__APPLE__) || defined(__HAIKU__)
|
||||
|
@ -123,7 +126,7 @@ bool rsGetHostByName(const std::string& hostname, in_addr& returned_addr)
|
|||
returned_addr.s_addr = *(unsigned long*) (result->h_addr);
|
||||
#endif
|
||||
|
||||
return true ;
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool isValidNet(const struct in_addr *addr)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue