diff options
author | Andrey Fomichev <andrey.fomichev@gmail.com> | 2022-02-10 16:49:15 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:15 +0300 |
commit | 1c61afbf3db63940d05e6fefa3104b03457788a1 (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /util/network/hostip.cpp | |
parent | e542cc14db4240643a06bb0dde87ecf361f101ab (diff) | |
download | ydb-1c61afbf3db63940d05e6fefa3104b03457788a1.tar.gz |
Restoring authorship annotation for Andrey Fomichev <andrey.fomichev@gmail.com>. Commit 2 of 2.
Diffstat (limited to 'util/network/hostip.cpp')
-rw-r--r-- | util/network/hostip.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/util/network/hostip.cpp b/util/network/hostip.cpp index 1acc3abfbff..cb8d43bf903 100644 --- a/util/network/hostip.cpp +++ b/util/network/hostip.cpp @@ -2,7 +2,7 @@ #include "hostip.h" #include <util/system/defaults.h> -#include <util/system/byteorder.h> +#include <util/system/byteorder.h> #if defined(_unix_) || defined(_cygwin_) #include <netdb.h> @@ -18,9 +18,9 @@ #endif #endif -int NResolver::GetHostIP(const char* hostname, ui32* ip, size_t* slots) { - size_t i = 0; - size_t ipsFound = 0; +int NResolver::GetHostIP(const char* hostname, ui32* ip, size_t* slots) { + size_t i = 0; + size_t ipsFound = 0; #ifdef AGENT_USE_GETADDRINFO int ret = 0; @@ -33,7 +33,7 @@ int NResolver::GetHostIP(const char* hostname, ui32* ip, size_t* slots) { if (gai_ret == 0 && gai_res->ai_addr) { struct addrinfo* cur = gai_res; for (i = 0; i < *slots && cur; i++, cur = cur->ai_next, ipsFound++) { - ip[i] = *(ui32*)(&((sockaddr_in*)(cur->ai_addr))->sin_addr); + ip[i] = *(ui32*)(&((sockaddr_in*)(cur->ai_addr))->sin_addr); } } else { if (gai_ret == EAI_NONAME || gai_ret == EAI_SERVICE) { @@ -61,10 +61,10 @@ int NResolver::GetHostIP(const char* hostname, ui32* ip, size_t* slots) { char** cur = hostent->h_addr_list; for (i = 0; i < *slots && *cur; i++, cur++, ipsFound++) - ip[i] = *(ui32*)*cur; + ip[i] = *(ui32*)*cur; #endif for (i = 0; i < ipsFound; i++) { - ip[i] = InetToHost(ip[i]); + ip[i] = InetToHost(ip[i]); } *slots = ipsFound; |