This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/tomcat-native.git
commit 058f6ffa6c73546d63317eb170e153d106e54ad5 Author: Mark Thomas <ma...@apache.org> AuthorDate: Wed Jun 15 11:34:02 2022 +0100 IPv6 patches no longer required Tomcat Native 2.0.x doesn't perform any network IO, only TLS encryption and decryption. --- native/srclib/apr/apr-enable-ipv6.patch | 11 --- native/srclib/apr/win-ipv6.patch | 125 -------------------------------- 2 files changed, 136 deletions(-) diff --git a/native/srclib/apr/apr-enable-ipv6.patch b/native/srclib/apr/apr-enable-ipv6.patch deleted file mode 100644 index a58721c01..000000000 --- a/native/srclib/apr/apr-enable-ipv6.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- /include/apr.hw -+++ /include/apr.hw -@@ -367,7 +367,7 @@ - /* If we have a TCP implementation that can be "corked", what flag - * do we use? - */ --#define APR_TCP_NOPUSH_FLAG @apr_tcp_nopush_flag@ -+#define APR_TCP_NOPUSH_FLAG 0 - - /* Is the TCP_NODELAY socket option inherited from listening sockets? - */ diff --git a/native/srclib/apr/win-ipv6.patch b/native/srclib/apr/win-ipv6.patch deleted file mode 100644 index 103987242..000000000 --- a/native/srclib/apr/win-ipv6.patch +++ /dev/null @@ -1,125 +0,0 @@ -Index: apr/apr/branches/1.7.x/include/arch/win32/apr_arch_misc.h -=================================================================== ---- apr/apr/branches/1.7.x/include/arch/win32/apr_arch_misc.h (revision 1890229) -+++ apr/apr/branches/1.7.x/include/arch/win32/apr_arch_misc.h (revision 1890230) -@@ -110,7 +110,11 @@ - APR_WIN_XP_SP2 = 62, - APR_WIN_2003 = 70, - APR_WIN_VISTA = 80, -- APR_WIN_7 = 90 -+ APR_WIN_7 = 90, -+ APR_WIN_7_SP1 = 91, -+ APR_WIN_8 = 100, -+ APR_WIN_8_1 = 110, -+ APR_WIN_10 = 120 - } apr_oslevel_e; - - extern APR_DECLARE_DATA apr_oslevel_e apr_os_level; -Index: apr/apr/branches/1.7.x/misc/win32/misc.c -=================================================================== ---- apr/apr/branches/1.7.x/misc/win32/misc.c (revision 1890229) -+++ apr/apr/branches/1.7.x/misc/win32/misc.c (revision 1890230) -@@ -27,25 +27,15 @@ - { - if (apr_os_level == APR_WIN_UNK) - { -- static OSVERSIONINFO oslev; -- oslev.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); -- GetVersionEx(&oslev); -+ OSVERSIONINFOEXW oslev; -+ oslev.dwOSVersionInfoSize = sizeof(oslev); -+ if (!GetVersionExW((OSVERSIONINFOW*) &oslev)) { -+ return apr_get_os_error(); -+ } - - if (oslev.dwPlatformId == VER_PLATFORM_WIN32_NT) - { -- static unsigned int servpack = 0; -- TCHAR *pservpack; -- if ((pservpack = oslev.szCSDVersion)) { -- while (*pservpack && !apr_isdigit(*pservpack)) { -- pservpack++; -- } -- if (*pservpack) --#ifdef _UNICODE -- servpack = _wtoi(pservpack); --#else -- servpack = atoi(pservpack); --#endif -- } -+ unsigned int servpack = oslev.wServicePackMajor; - - if (oslev.dwMajorVersion < 3) { - apr_os_level = APR_WIN_UNSUP; -@@ -99,11 +89,19 @@ - else if (oslev.dwMajorVersion == 6) { - if (oslev.dwMinorVersion == 0) - apr_os_level = APR_WIN_VISTA; -+ else if (oslev.dwMinorVersion == 1) { -+ if (servpack < 1) -+ apr_os_level = APR_WIN_7; -+ else -+ apr_os_level = APR_WIN_7_SP1; -+ } -+ else if (oslev.dwMinorVersion == 2) -+ apr_os_level = APR_WIN_8; - else -- apr_os_level = APR_WIN_7; -+ apr_os_level = APR_WIN_8_1; - } - else { -- apr_os_level = APR_WIN_XP; -+ apr_os_level = APR_WIN_10; - } - } - #ifndef WINNT -@@ -151,7 +149,7 @@ - - *level = apr_os_level; - -- if (apr_os_level < APR_WIN_UNSUP) { -+ if (apr_os_level <= APR_WIN_UNSUP) { - return APR_EGENERAL; - } - -Index: apr/apr/branches/1.7.x/network_io/win32/sockets.c -=================================================================== ---- apr/apr/branches/1.7.x/network_io/win32/sockets.c (revision 1890229) -+++ apr/apr/branches/1.7.x/network_io/win32/sockets.c (revision 1890230) -@@ -24,6 +24,13 @@ - #include "apr_arch_inherit.h" - #include "apr_arch_misc.h" - -+/* Borrow the definition of SOMAXCONN_HINT() from Windows SDK 8, -+ * in case the SDK we are building against doesn't have it. -+ */ -+#ifndef SOMAXCONN_HINT -+#define SOMAXCONN_HINT(b) (-(b)) -+#endif -+ - static char generic_inaddr_any[16] = {0}; /* big enough for IPv4 or IPv6 */ - - static apr_status_t socket_cleanup(void *sock) -@@ -223,7 +230,21 @@ - APR_DECLARE(apr_status_t) apr_socket_listen(apr_socket_t *sock, - apr_int32_t backlog) - { -- if (listen(sock->socketdes, backlog) == SOCKET_ERROR) -+ int backlog_val; -+ -+ if (apr_os_level >= APR_WIN_8) { -+ /* Starting from Windows 8, listen() accepts a special SOMAXCONN_HINT() -+ * arg that allows setting the listen backlog value to a larger -+ * value than the predefined Winsock 2 limit (several hundred). -+ * https://blogs.msdn.microsoft.com/winsdk/2015/06/01/winsocks-listen-backlog-offers-more-flexibility-in-windows-8/ -+ */ -+ backlog_val = SOMAXCONN_HINT(backlog); -+ } -+ else { -+ backlog_val = backlog; -+ } -+ -+ if (listen(sock->socketdes, backlog_val) == SOCKET_ERROR) - return apr_get_netos_error(); - else - return APR_SUCCESS; --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org