merged upstream/master

This commit is contained in:
csoler 2017-04-30 20:14:23 +02:00
commit cecd9a3368
136 changed files with 5050 additions and 2182 deletions

View file

@ -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.

View file

@ -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)