summaryrefslogtreecommitdiff
path: root/misc
Commit message (Collapse)AuthorAgeFilesLines
* Remove trailing whitespaces in *.c.Ivan Zhakov2022-11-2013-96/+96
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1905414 13f79535-47bb-0310-9956-ffa450edef68
* * misc/win32/apr_app.c: Cleanup unused #include directives.Ivan Zhakov2022-06-191-2/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902060 13f79535-47bb-0310-9956-ffa450edef68
* win32: Fix double free on exit when apr_app is used on Windows. [Ivan Zhakov]Ivan Zhakov2022-06-191-2/+4
| | | | | | | | | | * CHANGES: Add changelog entry. * misc/win32/apr_app.c (wmain): Do not free _wenviron -- MSVCRT automatically free 'initial' environment block on exit. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902059 13f79535-47bb-0310-9956-ffa450edef68
* win32: Fix attempt to free invalid memory on exit when apr_app is used.Ivan Zhakov2022-06-191-5/+27
| | | | | | | | | * CHANGES: Add changelog entry. * misc/win32/apr_app.c (wmain): Allocate separate heap entry for every environment variable. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902058 13f79535-47bb-0310-9956-ffa450edef68
* Normalize ucs-4 to utf-32 (documentation change)William A. Rowe Jr2022-05-241-3/+3
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1901212 13f79535-47bb-0310-9956-ffa450edef68
* TAB police ... get rid of missmatch of TAB and spaces through the codeMladen Turk2021-12-022-95/+95
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1895517 13f79535-47bb-0310-9956-ffa450edef68
* Get rid of check for old versions that cannot be run anyhowMladen Turk2021-12-021-26/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1895512 13f79535-47bb-0310-9956-ffa450edef68
* Stage 3 in cleaning win95 code ... cleanup headersMladen Turk2021-12-021-51/+44
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1895511 13f79535-47bb-0310-9956-ffa450edef68
* Stage 1 in cleaning win95 code ... cleanup utilsMladen Turk2021-12-021-112/+56
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1895509 13f79535-47bb-0310-9956-ffa450edef68
* Stage 3 in dismantling _WIN32_WCE ... cleanup codeMladen Turk2021-12-025-67/+2
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1895508 13f79535-47bb-0310-9956-ffa450edef68
* apr_errno: add APR_EALREADY, eventually mapped from system's [WSA]EALREADY.Yann Ylavic2020-11-271-0/+2
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1883874 13f79535-47bb-0310-9956-ffa450edef68
* win32: Rewrite late linking code (again) without using INIT_ONCE as groundworkIvan Zhakov2019-12-141-34/+41
| | | | | | | | | | | | | | | | | | | | | | | to backport r1866562 and 1859477 to APR 1.6.x and APR 1.7.x. It also slightly improves performance and reduce lock contention. * include/arch/win32/apr_arch_misc.h (apr_winapi_fpt_##fn): Declare as volatile and initialize to (ULONG_PTR) -1. (apr_winapi_ctrl_##fn, apr_winapi_init_once_##fn): Remove. (apr_winapi_ld_##fn): Concurrently invoke apr_load_dll_func() if apr_winapi_fpt_##fn == -1. * misc/win32/misc.c (win32_late_dll_t.control): Remove. (win32_late_dll_t.dll_handle): Declare as volatile. (late_dll): Initialize dll_handle to INVALID_HANDLE_VALUE (assume that is invalid module handle). (apr_load_dll_func): Concurrently load library if dll_handle == INVALID_HANDLE_VALUE. Then perform CAS and then free library if other thread performed initialization before. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1871447 13f79535-47bb-0310-9956-ffa450edef68
* win32: Try to avoid loading shell32.dll whenever possible:Ivan Zhakov2019-12-092-9/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. shell32.dll has about 19 dependencies. 2. shell32.dll depends on user32/gdi32.dll and loading them makes the process a "GUI" process: - this slows down process initialization and shutdown [1] - doesn't allow enabling mitigation to block win32k.sys for process using APR. 3. shell32.dll is not available on Windows Nano Server The only used function from shell32.dll is CommandLineToArgW. It is used to parse command-line arguments in apr_app_initialize(). The solution is twofold: 1. Delay loading shell32.dll. 2. Prefer to use api-ms-win-downlevel-shell32-l1-1-0.dll API Set instead of shell32.dll (Windows 8+) * include/arch/win32/apr_arch_misc.h (apr_dlltoken_e): Add DLL_API_MS_WIN_DOWNLEVEL_SHELL32_L1_1_0. (CommandLineToArgvW): Add late late dll func for CommandLineToArgvW. * misc/win32/misc.c (load_dll_callback): Support API Sets. * misc/win32/start.c (apr_app_initialize): Use apr_winapi_CommandLineToArgvW() instead of CommandLineToArgvW(). [1] https://randomascii.wordpress.com/2018/12/03/a-not-called-function-can-cause-a-5x-slowdown/ git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1871082 13f79535-47bb-0310-9956-ffa450edef68
* ucs2 is a legacy name, the correct encoding namesWilliam A. Rowe Jr2019-10-294-48/+52
| | | | | | | | | | | | | | | | are now utf-8, utf-16, and utf-32, so we rename; apr_conv_utf8_to_ucs2 -> apr_conv_utf8_to_utf16 apr_conv_ucs2_to_utf8 -> apr_conv_utf16_to_utf8 This patch notices an error message printing of an internal password, which will no longer be echoed to the error stream. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1869127 13f79535-47bb-0310-9956-ffa450edef68
* * include/arch/win32/apr_arch_misc.hIvan Zhakov2019-06-111-2/+6
| | | | | | | | | | (enum apr_oslevel_e): Add APR_WIN_7_SP1. * misc/win32/misc.c (apr_get_oslevel): Determine whether we are running on Windows 7 or on Windows 7 SP1. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1861061 13f79535-47bb-0310-9956-ffa450edef68
* Fix problem that apr_get_oslevel() was returning APR_WIN_XP on Windows 10.Ivan Zhakov2019-06-111-1/+1
| | | | | | | | | | * include/arch/win32/apr_arch_misc.h (enum apr_oslevel_e): Add APR_WIN_10. * misc/win32/misc.c (apr_get_oslevel): Return APR_WIN_10 when dwMajorVersion is greater than 6. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1861054 13f79535-47bb-0310-9956-ffa450edef68
* * include/arch/win32/apr_arch_misc.hIvan Zhakov2019-06-111-1/+3
| | | | | | | | | | (enum apr_oslevel_e): Add APR_WIN_8_1. * misc/win32/misc.c (apr_get_oslevel): Determine whether we are running on Windows 8 or on Windows 8.1+. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1861053 13f79535-47bb-0310-9956-ffa450edef68
* * misc/win32/misc.cIvan Zhakov2019-06-111-1/+1
| | | | | | | (apr_get_oslevel): Fix condition to actually return APR_EGENERAL on unsupported OS. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1861050 13f79535-47bb-0310-9956-ffa450edef68
* * misc/win32/misc.cIvan Zhakov2019-06-111-16/+4
| | | | | | | (apr_get_oslevel): Use GetVersionExW() with OSVERSIONINFOEXW to version information with service pack info. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1861049 13f79535-47bb-0310-9956-ffa450edef68
* * misc/win32/misc.cIvan Zhakov2019-06-111-2/+2
| | | | | | | (apr_get_oslevel): Do not use static variables to protect from potential race condition. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1861046 13f79535-47bb-0310-9956-ffa450edef68
* * misc/win32/misc.cIvan Zhakov2019-06-111-1/+3
| | | | | | | (apr_get_oslevel): Check return code from GetVersionEx(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1861045 13f79535-47bb-0310-9956-ffa450edef68
* Windows platform: Use NtWaitForSingleObject() [1] directly to wait for kernelIvan Zhakov2019-05-281-21/+53
| | | | | | | | | | | | | object: - NtWaitForSingleObject supports sub-milliseconds timeouts - NtWaitForSingleObject supports timeouts more than 49 days NtWaitForSingleObject is documented [1], but marked as 'deprecated' so we still leave fallback code based on WaitForSingleObject(). [1] https://docs.microsoft.com/en-us/windows/desktop/api/winternl/nf-winternl-ntwaitforsingleobject git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1860191 13f79535-47bb-0310-9956-ffa450edef68
* win32: Factor out common code to private function apr_wait_for_single_object().Ivan Zhakov2019-05-261-0/+30
| | | | | | | | | | | | | | | | | This function almost the same as WaitForSingleObject() except it accepts timeout value in microseconds, instead of milliseconds. * include/arch/win32/apr_arch_misc.h * misc/win32/misc.c (apr_wait_for_single_object): New. Factored out from thread_cond_timedwait(). * locks/win32/proc_mutex.c * locks/win32/thread_cond.c * locks/win32/thread_mutex.c (apr_proc_mutex_timedlock, thread_cond_timedwait, apr_thread_mutex_timedlock): Use apr_wait_for_single_object(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1860075 13f79535-47bb-0310-9956-ffa450edef68
* apr_generate_random_bytes: Use BCryptGenRandom() instead of CryptGenRandom()Ivan Zhakov2019-05-211-18/+12
| | | | | | | on Windows. BCryptGenRandom() is significantly faster since it doesn't require to load crypto provider on every invocation. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1859608 13f79535-47bb-0310-9956-ffa450edef68
* win32: Use INIT_ONCE to prevent loading delayed libraries multiple times.Ivan Zhakov2019-05-181-16/+29
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1859477 13f79535-47bb-0310-9956-ffa450edef68
* win32: Use LoadLibraryW() instead of LoadLibraryA() to late load libraries.Ivan Zhakov2019-05-161-9/+9
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1859405 13f79535-47bb-0310-9956-ffa450edef68
* Refactoring: Combine lateDllName and lateDllHandle arrays to one array ofIvan Zhakov2019-05-161-15/+23
| | | | | | structures. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1859404 13f79535-47bb-0310-9956-ffa450edef68
* Fix issue 61109: Use LocalFree() instead of GlobalFree() to free result ofIvan Zhakov2019-05-161-1/+1
| | | | | | CommandLineToArgvW(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1859402 13f79535-47bb-0310-9956-ffa450edef68
* Replace the link-time pragma from r1839494 with APR_DECLARE_LATE_DLL_FUNC William A. Rowe Jr2019-03-191-2/+4
| | | | | | | | resolution of if_indextoname and if_nametoindex. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1855855 13f79535-47bb-0310-9956-ffa450edef68
* Spelling corrections in docs;William A. Rowe Jr2018-08-301-1/+1
| | | | | | | | | | | | | | | Pull request #6 docs/APRDesign.html docs/canonical_filenames.html docs/incomplete_types Submitted by: "Bruno P. Kinoshita" <brunodepaulak yahoo.com.br> Pull request #10 misc/unix/errorcodes.c Submitted by: Jimmy Casey <casey.jimmy gmail.com> git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1839622 13f79535-47bb-0310-9956-ffa450edef68
* Follow-up to r1832203.Christophe Jaillet2018-08-251-1/+1
| | | | | | Fix missing 'args' declaration git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1839113 13f79535-47bb-0310-9956-ffa450edef68
* rand: follow up to r1814240: still honor --with-devrandom if specified.Yann Ylavic2018-06-011-4/+5
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1832691 13f79535-47bb-0310-9956-ffa450edef68
* Fix a potential usage of an un-init variable. (i.e. 'wch')Christophe Jaillet2018-05-241-7/+5
| | | | | | | | | Up to now, this can NOT happen, because the only caller passes -1 for 'args'. So axe this useless parameter to avoid troubles. See PR 60086. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1832203 13f79535-47bb-0310-9956-ffa450edef68
* fix ifdef for arc4randomEric Covener2018-01-101-1/+1
| | | | | | | | | | | | | r1814239 added: AC_CHECK_FUNCS(arc4random_buf) Which only defines HAVE_ARC4RANDOM_BUF git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1820755 13f79535-47bb-0310-9956-ffa450edef68
* rand: follow up to r1814239, r1814240 and r1814326.Yann Ylavic2017-11-051-63/+69
| | | | | | | | | | | | | | | | | | The above commits added the checks for HAVE_GETRANDOM and HAVE_ARC4RANDOM first in configure.in so to avoid breaking the AC_MESSAGE_CHECKING/RESULT line, thus it also defined the macros unconditionally (while the others were and still are only defined if no previous one is elected already). Yet the top priority one should remain HAVE_EGD when --with-egd is specified, so we now have to rearrange apr_generate_random_bytes()'s #ifdefs to preserve that now. While at it, let's add an #error for the "should not happen" case where APR_HAS_RANDOM is defined but no implementation is found. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1814331 13f79535-47bb-0310-9956-ffa450edef68
* rand: follow up to r1814240 and r1814326.Yann Ylavic2017-11-041-1/+3
| | | | | | | | Thanks Brane, <sys/random.h> may be available w/o getrandom(), and obviously we must not USE_GETRANDOM in this case. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1814329 13f79535-47bb-0310-9956-ffa450edef68
* rand: follow up to r1814240.Yann Ylavic2017-11-041-2/+21
| | | | | | | | Fall back to using SYS_getrandom syscall when it's available in linux (3.17+) but not in glibc (2.25+, not very deployed yet). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1814326 13f79535-47bb-0310-9956-ffa450edef68
* rand: add support for getrandom() on Linux as an entropy source.Yann Ylavic2017-11-041-1/+21
| | | | | | | | | | | Use it for apr_generate_random_bytes() when available, reading from the urandom source, and non-blocking such that the call fails with EAGAIN if there is not enough entropy on the system (which shouldn't be the case in userspace). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1814240 13f79535-47bb-0310-9956-ffa450edef68
* rand: add support for the arc4random API as an entropy source.Yann Ylavic2017-11-031-1/+5
| | | | | | | | | | | | | The arc4random API originates from OpenBSD where it supersedes random(3), rand(3), and files in the /dev filesystem. Use it for apr_generate_random_bytes(). Proposed by: Christian Weisgerber Reviewed by: ylavic git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1814239 13f79535-47bb-0310-9956-ffa450edef68
* apr_socket_listen(): Allow larger backlog queue lengths on Windows 8+.Ivan Zhakov2017-08-171-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Starting with Windows 8, the socket listen() function accepts a special SOMAXCONN_HINT(N) argument that allows making the backlog queue length larger than the otherwise predefined limit of around 200: https://msdn.microsoft.com/en-us/library/windows/desktop/ms739168 https://blogs.msdn.microsoft.com/winsdk/2015/06/01/winsocks-listen-backlog-offers-more-flexibility-in-windows-8/ Having a larger listen backlog can be used for certain high performance applications that need to handle lots of incoming connections. One example would be the httpd server with it's "ListenBacklog" directive where setting it to a larger value currently allows serving more concurrent connections on Windows with mpm_winnt. * include/arch/win32/apr_arch_misc.h (enum apr_oslevel_e): Add APR_WIN_8. * misc/win32/misc.c (apr_get_oslevel): Determine whether we are running on Windows 7 or on Windows 8+. * network_io/win32/sockets.c (SOMAXCONN_HINT): Define this macro in case we are building against an older version of Windows SDK. (apr_socket_listen): Use SOMAXCONN_HINT() for the backlog queue length if it's supported by the Windows version we are running on. Patch by: Evgeny Kotkov <evgeny.kotkov {at} visualsvn.com> git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1805309 13f79535-47bb-0310-9956-ffa450edef68
* Add a few error code strings that got lost/awal in the apr-util migration.Dirk-Willem van Gulik2017-01-191-0/+11
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1779500 13f79535-47bb-0310-9956-ffa450edef68
* Add some missing error messages to apr_error_stringStefan Fritsch2014-05-091-2/+9
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1593611 13f79535-47bb-0310-9956-ffa450edef68
* Remove more Win9x support (trunk only).Jeff Trawick2014-01-181-27/+0
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1559408 13f79535-47bb-0310-9956-ffa450edef68
* fix typo in commentJeff Trawick2014-01-181-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1559376 13f79535-47bb-0310-9956-ffa450edef68
* Drop the incomplete LDAP abstraction layer from APR 2.0 as decided on-list.William A. Rowe Jr2011-05-311-4/+0
| | | | | | | | It was not possible to use this interface without ldap provider internals. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1129809 13f79535-47bb-0310-9956-ffa450edef68
* revert part of r892177, which inadvertently enabled Win32Jeff Trawick2011-05-121-1/+0
| | | | | | | handle debugging for this file by including apr_dbg_win32_handles.h git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1102149 13f79535-47bb-0310-9956-ffa450edef68
* revert r1102138, as the feature is supposed to beJeff Trawick2011-05-121-4/+1
| | | | | | | | | usable by including apr_dbg_win32_handles.h in any particular source file, which in turn requires that apr_dbg_log() always be exported git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1102145 13f79535-47bb-0310-9956-ffa450edef68
* Don't unconditionally include apr_dbg_win32_handles.hJeff Trawick2011-05-111-1/+4
| | | | | | | | | | | | anywhere (misc.c), as it enables special handle debugging support within APR. In lieu of editing apr_private.h, allow enabling this handle debugging by defining APR_DBG_WIN32_HANDLES at compile time. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1102138 13f79535-47bb-0310-9956-ffa450edef68
* Fix VC10 release build running on Windows7/Server 2008 William A. Rowe Jr2011-04-141-21/+26
| | | | | | | | Submitted by: Steve Hay <SteveHay planit.com> Forward ports: 1092025 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1092026 13f79535-47bb-0310-9956-ffa450edef68
* Blocked pragmas to avoid warnings with other compilers.Guenter Knauf2011-04-121-7/+8
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1091274 13f79535-47bb-0310-9956-ffa450edef68