From: Nishi Date: Thu, 26 Sep 2024 00:33:22 +0000 (+0000) Subject: add an option to disable getaddrinfo X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=4ffb0d9d2abdfabcd6cfbf343f67fcf6a603b507;p=tewi.git add an option to disable getaddrinfo git-svn-id: file:///raid/svn-personal/tewi/trunk@163 8739d7e6-ffea-ec47-b151-bdff447c6205 --- diff --git a/Server/server.c b/Server/server.c index dea62ec..8c7ea20 100644 --- a/Server/server.c +++ b/Server/server.c @@ -30,8 +30,10 @@ #include #ifdef __MINGW32__ +#ifndef NO_GETADDRINFO #include #include +#endif #include #include #include @@ -47,8 +49,10 @@ #include #include #include +#ifndef NO_GETADDRINFO #include #endif +#endif #ifdef __HAIKU__ #include @@ -448,8 +452,10 @@ int32_t tw_server_pass(void* ptr) { char address[513]; address[0] = 0; +#ifndef NO_GETADDRINFO struct sockaddr* sa = (struct sockaddr*)&addr; getnameinfo(sa, sizeof(addr), address, 512, NULL, 0, NI_NUMERICHOST); +#endif struct tw_http_request req; struct tw_http_response res; diff --git a/Server/tw_version.h b/Server/tw_version.h index ed6becd..05640c3 100644 --- a/Server/tw_version.h +++ b/Server/tw_version.h @@ -7,7 +7,7 @@ extern "C" { #endif -#define TW_VERSION "1.08\0" +#define TW_VERSION "1.08A\0" const char* tw_get_version(void); const char* tw_get_platform(void); diff --git a/Server/version.c b/Server/version.c index bd2514d..c4cbb4c 100644 --- a/Server/version.c +++ b/Server/version.c @@ -17,6 +17,8 @@ const char* tw_platform = "Windows" #elif defined(__HAIKU__) "Haiku" +#elif defined(__CYGWIN__) + "Cygwin" #else "Unix" #endif diff --git a/config.h.tmpl b/config.h.tmpl index 7666cd0..7b18bff 100644 --- a/config.h.tmpl +++ b/config.h.tmpl @@ -8,6 +8,7 @@ #undef NO_SSL #define USE_POLL #define HAS_CHROOT +#undef NO_GETADDRINFO /* DO NOT EDIT BELOW THIS LINE */