diff options
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | configure.ac | 93 | ||||
-rw-r--r-- | src/microhttpd/test_options.c | 6 |
3 files changed, 104 insertions, 6 deletions
@@ -1,3 +1,8 @@ | |||
1 | Wed 07 Oct 2020 11:07:00 MSK | ||
2 | W32 default target version changed to Vista, XP is still supported. | ||
3 | Minor fixes and additional asserts for memorypool. | ||
4 | IPv6 tests are not used if IPv6 is disabled at run-time. -EG | ||
5 | |||
1 | Sun 27 Sep 2020 10:08:03 PM CEST | 6 | Sun 27 Sep 2020 10:08:03 PM CEST |
2 | Fixed incorrect triggering of epoll edge polling for | 7 | Fixed incorrect triggering of epoll edge polling for |
3 | "upgraded" TLS connections. Fixed a few cases where | 8 | "upgraded" TLS connections. Fixed a few cases where |
@@ -16,7 +21,7 @@ Thu 24 Sep 2020 16:55:00 MSK | |||
16 | the registries. | 21 | the registries. |
17 | Fixed portability of test_upgrade_large. | 22 | Fixed portability of test_upgrade_large. |
18 | Minor testsuite fixes. | 23 | Minor testsuite fixes. |
19 | Restored parallel build of libmicrohttpd (except tests). | 24 | Restored parallel build of libmicrohttpd (except tests). -EG |
20 | 25 | ||
21 | Fri 11 Sep 2020 10:08:22 PM CEST | 26 | Fri 11 Sep 2020 10:08:22 PM CEST |
22 | Fix crash problem in PostProcessor reported by MD. -CG | 27 | Fix crash problem in PostProcessor reported by MD. -CG |
@@ -205,11 +210,11 @@ Mon May 20 15:39:35 MSK 2019 | |||
205 | Compiler warning fixes. -EG/CG | 210 | Compiler warning fixes. -EG/CG |
206 | Fixed example for non-64bits platforms. -EG | 211 | Fixed example for non-64bits platforms. -EG |
207 | 212 | ||
208 | Web May 15 23:51:49 MSK 2019 | 213 | Wed May 15 23:51:49 MSK 2019 |
209 | Optimized and improved processing speed by using precalculated and | 214 | Optimized and improved processing speed by using precalculated and |
210 | already calculated lengths of strings. -EG | 215 | already calculated lengths of strings. -EG |
211 | 216 | ||
212 | Web May 15 14:54:00 MSK 2019 | 217 | Wed May 15 14:54:00 MSK 2019 |
213 | Fixed build from source on GNU Hurd. -EG | 218 | Fixed build from source on GNU Hurd. -EG |
214 | 219 | ||
215 | Mon May 6 11:58:00 MSK 2019 | 220 | Mon May 6 11:58:00 MSK 2019 |
diff --git a/configure.ac b/configure.ac index 7db4df29..d8d12277 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -2129,6 +2129,99 @@ AC_CACHE_CHECK([[for calloc()]], [[mhd_cv_have_func_calloc]], | |||
2129 | AS_VAR_IF([[mhd_cv_have_func_calloc]], [["yes"]], | 2129 | AS_VAR_IF([[mhd_cv_have_func_calloc]], [["yes"]], |
2130 | [AC_DEFINE([[HAVE_CALLOC]], [[1]], [Define to 1 if you have the usable `calloc' function.])]) | 2130 | [AC_DEFINE([[HAVE_CALLOC]], [[1]], [Define to 1 if you have the usable `calloc' function.])]) |
2131 | 2131 | ||
2132 | # Some systems have IPv6 disabled in kernel at run-time | ||
2133 | AS_IF([[test "x${have_inet6}" = "xyes" && test "x${cross_compiling}" = "xno"]], | ||
2134 | [ | ||
2135 | AC_CACHE_CHECK([whether IPv6 could be used for testing],[mhd_cv_ipv6_for_testing], | ||
2136 | [ | ||
2137 | AC_RUN_IFELSE( | ||
2138 | [ | ||
2139 | AC_LANG_SOURCE([[ | ||
2140 | #ifdef HAVE_UNISTD_H | ||
2141 | #include <unistd.h> | ||
2142 | #endif | ||
2143 | #ifdef HAVE_SYS_TYPES_H | ||
2144 | #include <sys/types.h> | ||
2145 | #endif | ||
2146 | #ifdef HAVE_SYS_SOCKET_H | ||
2147 | #include <sys/socket.h> | ||
2148 | #endif | ||
2149 | #ifdef HAVE_WINSOCK2_H | ||
2150 | #include <winsock2.h> | ||
2151 | #endif | ||
2152 | #ifdef HAVE_WS2TCPIP_H | ||
2153 | #include <ws2tcpip.h> | ||
2154 | #endif | ||
2155 | #ifdef HAVE_NETINET_IN_H | ||
2156 | #include <netinet/in.h> | ||
2157 | #endif | ||
2158 | #ifdef HAVE_NETINET_IP_H | ||
2159 | #include <netinet/ip.h> | ||
2160 | #endif | ||
2161 | #ifdef HAVE_ARPA_INET_H | ||
2162 | #include <arpa/inet.h> | ||
2163 | #endif | ||
2164 | #ifdef HAVE_NETINET_TCP_H | ||
2165 | #include <netinet/tcp.h> | ||
2166 | #endif | ||
2167 | |||
2168 | static void zr_mem(void *ptr, socklen_t size) | ||
2169 | { char *mem = ptr; while(size--) {mem[0] = 0; mem++;} } | ||
2170 | |||
2171 | int main(void) | ||
2172 | { | ||
2173 | int ret = 30; | ||
2174 | struct sockaddr_in6 sa; | ||
2175 | #if !defined(_WIN32) || defined(__CYGWIN__) | ||
2176 | int sckt; | ||
2177 | const int invld_sckt = -1; | ||
2178 | #else | ||
2179 | SOCKET sckt; | ||
2180 | const SOCKET invld_sckt = INVALID_SOCKET; | ||
2181 | WSADATA wsa_data; | ||
2182 | |||
2183 | WSAStartup(MAKEWORD(2, 2), &wsa_data); | ||
2184 | #endif | ||
2185 | zr_mem(&sa, sizeof(sa)); | ||
2186 | sa.sin6_family = AF_INET6; | ||
2187 | sa.sin6_port = 0; | ||
2188 | sa.sin6_addr = in6addr_loopback; | ||
2189 | #ifdef HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN | ||
2190 | sa.sin6_len = sizeof(sa); | ||
2191 | #endif | ||
2192 | sckt = socket (PF_INET6, SOCK_STREAM, 0); | ||
2193 | if (invld_sckt != sckt) | ||
2194 | { | ||
2195 | if (0 == bind (sckt, (struct sockaddr *)&sa, sizeof(sa))) | ||
2196 | { | ||
2197 | if (0 == listen (sckt, 1)) | ||
2198 | ret = 0; | ||
2199 | else | ||
2200 | ret = 1; /* listen() failed */ | ||
2201 | } else ret = 2; /* bind() failed */ | ||
2202 | #if !defined(_WIN32) || defined(__CYGWIN__) | ||
2203 | close (sckt); | ||
2204 | #else | ||
2205 | closesocket (sckt); | ||
2206 | #endif | ||
2207 | } else ret = 3; /* socket() failed */ | ||
2208 | #if defined(_WIN32) && !defined(__CYGWIN__) | ||
2209 | WSACleanup(); | ||
2210 | #endif | ||
2211 | return ret; | ||
2212 | } | ||
2213 | ]]) | ||
2214 | ], [[mhd_cv_ipv6_for_testing="yes"]], [[mhd_cv_ipv6_for_testing="no"]], [[mhd_cv_ipv6_for_testing="no"]] | ||
2215 | ) | ||
2216 | ] | ||
2217 | ) | ||
2218 | ] | ||
2219 | ) | ||
2220 | AS_VAR_IF([mhd_cv_ipv6_for_testing],["yes"], | ||
2221 | [AC_DEFINE([[USE_IPV6_TESTING]], [[1]], [Define to 1 if your kernel supports IPv6 and IPv6 is enabled and useful for testing.])] | ||
2222 | ) | ||
2223 | |||
2224 | |||
2132 | # Check for fork() and waitpid(). They are used for tests. | 2225 | # Check for fork() and waitpid(). They are used for tests. |
2133 | AC_MSG_CHECKING([[for fork()]]) | 2226 | AC_MSG_CHECKING([[for fork()]]) |
2134 | mhd_have_fork_waitpid='no' | 2227 | mhd_have_fork_waitpid='no' |
diff --git a/src/microhttpd/test_options.c b/src/microhttpd/test_options.c index 9685837e..575b6a2b 100644 --- a/src/microhttpd/test_options.c +++ b/src/microhttpd/test_options.c | |||
@@ -84,7 +84,7 @@ test_ip_addr_option () | |||
84 | { | 84 | { |
85 | struct MHD_Daemon *d; | 85 | struct MHD_Daemon *d; |
86 | struct sockaddr_in daemon_ip_addr; | 86 | struct sockaddr_in daemon_ip_addr; |
87 | #if HAVE_INET6 | 87 | #if HAVE_INET6 && defined (USE_IPV6_TESTING) |
88 | struct sockaddr_in6 daemon_ip_addr6; | 88 | struct sockaddr_in6 daemon_ip_addr6; |
89 | #endif | 89 | #endif |
90 | 90 | ||
@@ -93,7 +93,7 @@ test_ip_addr_option () | |||
93 | daemon_ip_addr.sin_port = 0; | 93 | daemon_ip_addr.sin_port = 0; |
94 | daemon_ip_addr.sin_addr.s_addr = htonl (INADDR_LOOPBACK); | 94 | daemon_ip_addr.sin_addr.s_addr = htonl (INADDR_LOOPBACK); |
95 | 95 | ||
96 | #if HAVE_INET6 | 96 | #if HAVE_INET6 && defined (USE_IPV6_TESTING) |
97 | memset (&daemon_ip_addr6, 0, sizeof (struct sockaddr_in6)); | 97 | memset (&daemon_ip_addr6, 0, sizeof (struct sockaddr_in6)); |
98 | daemon_ip_addr6.sin6_family = AF_INET6; | 98 | daemon_ip_addr6.sin6_family = AF_INET6; |
99 | daemon_ip_addr6.sin6_port = 0; | 99 | daemon_ip_addr6.sin6_port = 0; |
@@ -109,7 +109,7 @@ test_ip_addr_option () | |||
109 | 109 | ||
110 | MHD_stop_daemon (d); | 110 | MHD_stop_daemon (d); |
111 | 111 | ||
112 | #if HAVE_INET6 | 112 | #if HAVE_INET6 && defined (USE_IPV6_TESTING) |
113 | d = MHD_start_daemon (MHD_USE_ERROR_LOG | MHD_USE_IPv6, 0, | 113 | d = MHD_start_daemon (MHD_USE_ERROR_LOG | MHD_USE_IPv6, 0, |
114 | NULL, NULL, &ahc_echo, NULL, MHD_OPTION_SOCK_ADDR, | 114 | NULL, NULL, &ahc_echo, NULL, MHD_OPTION_SOCK_ADDR, |
115 | &daemon_ip_addr6, MHD_OPTION_END); | 115 | &daemon_ip_addr6, MHD_OPTION_END); |