Loading ares/ares_fds.c +15 −14 Original line number Diff line number Diff line Loading @@ -26,7 +26,8 @@ int ares_fds(ares_channel channel, fd_set *read_fds, fd_set *write_fds) { struct server_state *server; int i, nfds; ares_socket_t nfds; int i; /* No queries, no file descriptors. */ if (!channel->queries) Loading @@ -51,5 +52,5 @@ int ares_fds(ares_channel channel, fd_set *read_fds, fd_set *write_fds) nfds = server->tcp_socket + 1; } } return nfds; return (int)nfds; } ares/ares_gethostbyaddr.c +40 −40 Original line number Diff line number Diff line Loading @@ -149,7 +149,7 @@ static int file_lookup(struct in_addr *addr, struct hostent **host) #ifdef WIN32 char PATH_HOSTS[MAX_PATH]; if (IsNT) { if (IS_NT()) { char tmp[MAX_PATH]; HKEY hkeyHosts; Loading ares/ares_gethostbyname.c +57 −57 Original line number Diff line number Diff line Loading @@ -221,7 +221,7 @@ static int file_lookup(const char *name, struct hostent **host) #ifdef WIN32 char PATH_HOSTS[MAX_PATH]; if (IsNT) { if (IS_NT()) { char tmp[MAX_PATH]; HKEY hkeyHosts; Loading ares/ares_init.c +93 −92 Original line number Diff line number Diff line Loading @@ -305,7 +305,8 @@ static int get_iphlpapi_dns_info (char *ret_buf, size_t ret_size) { FIXED_INFO *fi = alloca (sizeof(*fi)); DWORD size = sizeof (*fi); DWORD (WINAPI *GetNetworkParams) (FIXED_INFO*, DWORD*); /* available only on Win-98/2000+ */ typedef DWORD (WINAPI* get_net_param_func) (FIXED_INFO*, DWORD*); get_net_param_func GetNetworkParams; /* available only on Win-98/2000+ */ HMODULE handle; IP_ADDR_STRING *ipAddr; int i, count = 0; Loading @@ -321,7 +322,7 @@ static int get_iphlpapi_dns_info (char *ret_buf, size_t ret_size) if (!handle) return (0); (void*)GetNetworkParams = GetProcAddress (handle, "GetNetworkParams"); GetNetworkParams = (get_net_param_func) GetProcAddress (handle, "GetNetworkParams"); if (!GetNetworkParams) goto quit; Loading Loading @@ -375,7 +376,7 @@ quit: static int init_by_resolv_conf(ares_channel channel) { char *line = NULL; int status, nservers = 0, nsort = 0; int status = -1, nservers = 0, nsort = 0; struct server_state *servers = NULL; struct apattern *sortlist = NULL; Loading Loading @@ -421,7 +422,7 @@ DhcpNameServer goto okay; } if (IsNT) if (IS_NT()) { if (RegOpenKeyEx( HKEY_LOCAL_MACHINE, WIN_NS_NT_KEY, 0, Loading ares/windows_port.c +13 −7 Original line number Diff line number Diff line Loading @@ -39,28 +39,34 @@ ares_strcasecmp(const char *a, const char *b) } #endif /* * Number of micro-seconds between the beginning of the Windows epoch * (Jan. 1, 1601) and the Unix epoch (Jan. 1, 1970). */ #if defined(_MSC_VER) || defined(__WATCOMC__) #define EPOCH_FILETIME 11644473600000000Ui64 #else #define EPOCH_FILETIME 11644473600000000ULL #endif int ares_gettimeofday(struct timeval *tv, struct timezone *tz) { FILETIME ft; LARGE_INTEGER li; __int64 t; static int tzflag; if (tv) { GetSystemTimeAsFileTime(&ft); li.LowPart = ft.dwLowDateTime; li.HighPart = ft.dwHighDateTime; t = li.QuadPart; /* In 100-nanosecond intervals */ #if 0 t -= EPOCHFILETIME; /* Offset to the Epoch time */ #endif t /= 10; /* In microseconds */ t = li.QuadPart / 10; /* In micro-second intervals */ t -= EPOCH_FILETIME; /* Offset to the Epoch time */ tv->tv_sec = (long)(t / 1000000); tv->tv_usec = (long)(t % 1000000); } (void) tz; return 0; } Loading Loading
ares/ares_fds.c +15 −14 Original line number Diff line number Diff line Loading @@ -26,7 +26,8 @@ int ares_fds(ares_channel channel, fd_set *read_fds, fd_set *write_fds) { struct server_state *server; int i, nfds; ares_socket_t nfds; int i; /* No queries, no file descriptors. */ if (!channel->queries) Loading @@ -51,5 +52,5 @@ int ares_fds(ares_channel channel, fd_set *read_fds, fd_set *write_fds) nfds = server->tcp_socket + 1; } } return nfds; return (int)nfds; }
ares/ares_gethostbyaddr.c +40 −40 Original line number Diff line number Diff line Loading @@ -149,7 +149,7 @@ static int file_lookup(struct in_addr *addr, struct hostent **host) #ifdef WIN32 char PATH_HOSTS[MAX_PATH]; if (IsNT) { if (IS_NT()) { char tmp[MAX_PATH]; HKEY hkeyHosts; Loading
ares/ares_gethostbyname.c +57 −57 Original line number Diff line number Diff line Loading @@ -221,7 +221,7 @@ static int file_lookup(const char *name, struct hostent **host) #ifdef WIN32 char PATH_HOSTS[MAX_PATH]; if (IsNT) { if (IS_NT()) { char tmp[MAX_PATH]; HKEY hkeyHosts; Loading
ares/ares_init.c +93 −92 Original line number Diff line number Diff line Loading @@ -305,7 +305,8 @@ static int get_iphlpapi_dns_info (char *ret_buf, size_t ret_size) { FIXED_INFO *fi = alloca (sizeof(*fi)); DWORD size = sizeof (*fi); DWORD (WINAPI *GetNetworkParams) (FIXED_INFO*, DWORD*); /* available only on Win-98/2000+ */ typedef DWORD (WINAPI* get_net_param_func) (FIXED_INFO*, DWORD*); get_net_param_func GetNetworkParams; /* available only on Win-98/2000+ */ HMODULE handle; IP_ADDR_STRING *ipAddr; int i, count = 0; Loading @@ -321,7 +322,7 @@ static int get_iphlpapi_dns_info (char *ret_buf, size_t ret_size) if (!handle) return (0); (void*)GetNetworkParams = GetProcAddress (handle, "GetNetworkParams"); GetNetworkParams = (get_net_param_func) GetProcAddress (handle, "GetNetworkParams"); if (!GetNetworkParams) goto quit; Loading Loading @@ -375,7 +376,7 @@ quit: static int init_by_resolv_conf(ares_channel channel) { char *line = NULL; int status, nservers = 0, nsort = 0; int status = -1, nservers = 0, nsort = 0; struct server_state *servers = NULL; struct apattern *sortlist = NULL; Loading Loading @@ -421,7 +422,7 @@ DhcpNameServer goto okay; } if (IsNT) if (IS_NT()) { if (RegOpenKeyEx( HKEY_LOCAL_MACHINE, WIN_NS_NT_KEY, 0, Loading
ares/windows_port.c +13 −7 Original line number Diff line number Diff line Loading @@ -39,28 +39,34 @@ ares_strcasecmp(const char *a, const char *b) } #endif /* * Number of micro-seconds between the beginning of the Windows epoch * (Jan. 1, 1601) and the Unix epoch (Jan. 1, 1970). */ #if defined(_MSC_VER) || defined(__WATCOMC__) #define EPOCH_FILETIME 11644473600000000Ui64 #else #define EPOCH_FILETIME 11644473600000000ULL #endif int ares_gettimeofday(struct timeval *tv, struct timezone *tz) { FILETIME ft; LARGE_INTEGER li; __int64 t; static int tzflag; if (tv) { GetSystemTimeAsFileTime(&ft); li.LowPart = ft.dwLowDateTime; li.HighPart = ft.dwHighDateTime; t = li.QuadPart; /* In 100-nanosecond intervals */ #if 0 t -= EPOCHFILETIME; /* Offset to the Epoch time */ #endif t /= 10; /* In microseconds */ t = li.QuadPart / 10; /* In micro-second intervals */ t -= EPOCH_FILETIME; /* Offset to the Epoch time */ tv->tv_sec = (long)(t / 1000000); tv->tv_usec = (long)(t % 1000000); } (void) tz; return 0; } Loading