summaryrefslogtreecommitdiff
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* * include/apr_buckets.h: Ensure macro argument is only expandedjorton2020-03-111-4/+6
| | | | | | | once for apr_bucket_delete and apr_bucket_destroy. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1875097 13f79535-47bb-0310-9956-ffa450edef68
* Happy New Year 2020rjung2020-01-011-1/+1
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1872195 13f79535-47bb-0310-9956-ffa450edef68
* Follow-up to r1871082: Actually use api-ms-win-downlevel-shell32-l1-1-0.dllivan2019-12-231-4/+4
| | | | | | | | | | API Set. * include/arch/win32/apr_arch_misc.h (CommandLineToArgvW): Use DLL_API_MS_WIN_DOWNLEVEL_SHELL32_L1_1_0 instead of DLL_SHSTDAPI. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1871926 13f79535-47bb-0310-9956-ffa450edef68
* Follow-up to r1871447.ivan2019-12-231-3/+4
| | | | | | | | | * include/arch/win32/apr_arch_misc.h (APR_DECLARE_LATE_DLL_FUNC): Use direct memory write instead of InterlockedExchangePointer() since pointer-sized writes are atomic on Windows. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1871925 13f79535-47bb-0310-9956-ffa450edef68
* win32: Rewrite late linking code (again) without using INIT_ONCE as groundworkivan2019-12-141-14/+9
| | | | | | | | | | | | | | | | | | | | | | | 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: http://svn.apache.org/repos/asf/apr/apr/trunk@1871447 13f79535-47bb-0310-9956-ffa450edef68
* win32: Try to avoid loading shell32.dll whenever possible:ivan2019-12-091-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: http://svn.apache.org/repos/asf/apr/apr/trunk@1871082 13f79535-47bb-0310-9956-ffa450edef68
* ucs2 is a legacy name, the correct encoding nameswrowe2019-10-291-15/+17
| | | | | | | | | | | | | | | | 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: http://svn.apache.org/repos/asf/apr/apr/trunk@1869127 13f79535-47bb-0310-9956-ffa450edef68
* Remove the APR_SENDFILE_DISCONNECT_SOCKET flag.ivan2019-09-201-6/+1
| | | | | | | | | | | | | | | | | | There are several problems with this flag: 1. The TCP socket may be subject to the TCP TIME_WAIT state. That means apr_sock_sendfile() could occupy worker thread for significant time (30 seconds) 2. With this flag specified, the socket descriptor is removed from the apr_socket_t and the caller caller is expected to maintain the descriptor and release it manually, which is particularly error-prone. See also: https://lists.apache.org/thread.html/a3c4a03961a4b5842e7f657a15fe777edf5949b768a2807619a104b1@%3Cdev.apr.apache.org%3E git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1867226 13f79535-47bb-0310-9956-ffa450edef68
* win32: Remove unused code.ivan2019-09-071-27/+0
| | | | | | | | | * include/arch/win32/apr_arch_misc.h (PBI, apr_winapi_NtQueryInformationProcess, apr_winapi_NtQueryObject): Remove. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1866564 13f79535-47bb-0310-9956-ffa450edef68
* win32: Fix very unlikely race condition in late linking code.ivan2019-09-071-6/+11
| | | | | | | | * include/arch/win32/apr_arch_misc.h (APR_DECLARE_LATE_DLL_FUNC): Use INIT_ONCE to wait for concurrent DLL loading if any. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1866562 13f79535-47bb-0310-9956-ffa450edef68
* Revert r1862435, r1862071 per veto from ivanjorton2019-08-281-28/+0
| | | | | | | msgid: <CABw-3YcK0qbeYWDOwE684XtBj3rCT2CuVOBWWqda4gMtRyRJEw@mail.gmail.com> git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1866019 13f79535-47bb-0310-9956-ffa450edef68
* Add empty stubs for APR pool functions, that arerjung2019-07-171-28/+10
| | | | | | | | | | | | only needed when APR_POOL_DEBUG is defined, but can be aor should be called from app code. Providing stubs allows the app code to stay the same when running with or without debugging APR lib (no need for app recompilation). git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1863217 13f79535-47bb-0310-9956-ffa450edef68
* API/ABI change, drop return value of apr_thread_exit() which hasjorton2019-07-031-3/+3
| | | | | | | | | | | | no useful (nor documented) semantic: * include/apr_thread_proc.h (apr_thread_exit): Make void function; mark with gcc noreturn attribute. * threadproc/*/thread.c (apr_thread_exit): Update accordingly. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1862446 13f79535-47bb-0310-9956-ffa450edef68
* * include/apr_file_info.h: Clarify pool handling for apr_dir_read andjorton2019-07-021-3/+9
| | | | | | | | | | | | | | apr_dir_pread. * file_io/win32/dir.c, file_io/os2/dir.c (apr_dir_read): Duplicate the returned filename so the call has no side-effects on apr_finfo_t structures passed to previous invocations of the function. * test/testdir.c (test_read_side_effects): Add test case for side-effects of apr_dir_read. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1862435 13f79535-47bb-0310-9956-ffa450edef68
* Add apr_dir_pread(), a variant of apr_dir_read() which allows callersjorton2019-06-251-0/+22
| | | | | | | | | | | | | | | | | to read a directory with constant memory consumption: * include/apr_file_info.h: Add warning on memory consumption for apr_dir_read; declare apr_dir_pread. * file_io/unix/dir.c (apr_dir_pread): Rename from apr_dir_read and take pool argument. (apr_dir_read): Reimplement using it. * file_io/win32/dir.c, file_io/os2/dir.c: Likewise, but untested. * test/testdir.c (test_pread) [APR_POOL_DEBUG]: Add test case. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1862071 13f79535-47bb-0310-9956-ffa450edef68
* Revert r1833421 et al:minfrin2019-06-231-26/+0
| | | | | | | | Move OpenSSL initialisation back to apr_crypto_openssl, reinstate DSO support. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1861951 13f79535-47bb-0310-9956-ffa450edef68
* Revert r1833421 et al:minfrin2019-06-221-8/+0
| | | | | | | | Move NSS initialisation back to apr_crypto_nss, reinstate DSO support. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1861894 13f79535-47bb-0310-9956-ffa450edef68
* Revert r1833421 et al:minfrin2019-06-221-24/+0
| | | | | | | | | | Move commoncrypto initialisation back to apr_crypto_commoncrypto module, reinstate DSO support. Remove noop references to mscapi and mscng. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1861892 13f79535-47bb-0310-9956-ffa450edef68
* * include/arch/win32/apr_arch_misc.hivan2019-06-111-0/+1
| | | | | | | | | | (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: http://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.ivan2019-06-111-1/+2
| | | | | | | | | | * 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: http://svn.apache.org/repos/asf/apr/apr/trunk@1861054 13f79535-47bb-0310-9956-ffa450edef68
* * include/arch/win32/apr_arch_misc.hivan2019-06-111-1/+2
| | | | | | | | | | (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: http://svn.apache.org/repos/asf/apr/apr/trunk@1861053 13f79535-47bb-0310-9956-ffa450edef68
* apr_crypto_prng: Move openssl specific code into apr_crypto_openssl.minfrin2019-06-102-8/+60
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1860984 13f79535-47bb-0310-9956-ffa450edef68
* Make apr_*_inherit_set() actually work on Windows.ivan2019-06-071-9/+9
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1860783 13f79535-47bb-0310-9956-ffa450edef68
* Remove legacy and dead code from include/arch/win32/apr_arch_inherit.h.ivan2019-06-071-79/+0
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1860777 13f79535-47bb-0310-9956-ffa450edef68
* * include/arch/win32/apr_arch_file_io.hivan2019-06-071-12/+1
| | | | | | | | | (apr_dir_t): Remove union needed for ANSI support. * file_io/win32/dir.c (apr_dir_open, apr_dir_read): Update code to the changes above. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1860748 13f79535-47bb-0310-9956-ffa450edef68
* Windows platform: Use semaphore object instead of manual reset event toivan2019-06-071-2/+2
| | | | | | implement timed unnested apr_thread_mutex_t. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1860744 13f79535-47bb-0310-9956-ffa450edef68
* Windows platform: Use NtWaitForSingleObject() [1] directly to wait for kernelivan2019-05-281-0/+9
| | | | | | | | | | | | | 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: http://svn.apache.org/repos/asf/apr/apr/trunk@1860191 13f79535-47bb-0310-9956-ffa450edef68
* Windows platform: Use XmlLite by default in legacy build.ivan2019-05-271-1/+2
| | | | | | | | | * include/apr.hw (APU_USE_EXPAT): Define to 0. (APU_USE_XMLLITE): Define to 1. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1860161 13f79535-47bb-0310-9956-ffa450edef68
* Windows platform: Use WSAPoll directly.ivan2019-05-271-32/+0
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1860159 13f79535-47bb-0310-9956-ffa450edef68
* Windows platform: Provide a native XML parser implementation based onivan2019-05-271-0/+1
| | | | | | | | | | | | | | | | XmlLite [1]. Start using it by default if we weren't explicitly told to build with either libxml2 or expat. (This is a merge of the `xmllite` branch.) Doing so reduces the amount of dependencies required for building and using APR, which I believe to be a good thing in this particular case. And it also means that by default we would be relying on the native component of the OS rather than on a 3rd-party library. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1860150 13f79535-47bb-0310-9956-ffa450edef68
* win32: Factor out common code to private function apr_wait_for_single_object().ivan2019-05-261-0/+5
| | | | | | | | | | | | | | | | | 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: http://svn.apache.org/repos/asf/apr/apr/trunk@1860075 13f79535-47bb-0310-9956-ffa450edef68
* Use native Slim Reader/Writer (SRW) locks on Windows for apr_rwlock_t.ivan2019-05-201-3/+2
| | | | | | This fixes PR 45455 and 51360. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1859584 13f79535-47bb-0310-9956-ffa450edef68
* Use native one-time initialization [1] to implement apr_thread_once_t onivan2019-05-191-1/+1
| | | | | | | | | | | Windows. This also fixes problem that apr_thread_once() may return before the other read completes initialization on Windows. [1] https://docs.microsoft.com/en-gb/windows/desktop/Sync/one-time-initialization git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1859517 13f79535-47bb-0310-9956-ffa450edef68
* * include/apr.hw: Define _WIN32_WINNT to 0x0601 by default, since Windows 7ivan2019-05-191-1/+1
| | | | | | | is minimum supported Windows version. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1859513 13f79535-47bb-0310-9956-ffa450edef68
* win32: Do not use delay load for GetCompressedFileSize() and SetDllDirectoryW()ivan2019-05-181-29/+0
| | | | | | since there always available on all supported platforms. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1859475 13f79535-47bb-0310-9956-ffa450edef68
* Use documented GetFileInformationByHandleEx() instead ofivan2019-05-051-25/+0
| | | | | | | | | | | | | ZwQueryInformationFile() to allocated size of file. * file_io/win32/filestat.c (more_finfo): Use GetFileInformationByHandleEx(FileAllocationInfo). * include/arch/win32/apr_arch_misc.h (IOSB, FSI, apr_winapi_ZwQueryInformationFile): Remove. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1858659 13f79535-47bb-0310-9956-ffa450edef68
* Fix some missing doxygen documentation (even if ready to use!)jailletc362019-05-041-2/+4
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1858596 13f79535-47bb-0310-9956-ffa450edef68
* stdint.h and inttypes.h may include each other so define __STDC macros first.ylavic2019-03-221-5/+7
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1856050 13f79535-47bb-0310-9956-ffa450edef68
* Define __STDC_FORMAT_MACROS for C++'s inttypes.ylavic2019-03-221-2/+5
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1856046 13f79535-47bb-0310-9956-ffa450edef68
* Don't mangle Darwin's native [U]INT64_C macros.ylavic2019-03-221-10/+10
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1856043 13f79535-47bb-0310-9956-ffa450edef68
* Use stdint/inttypes 64bit types/formats when both available.ylavic2019-03-221-2/+7
| | | | | | | Which should be the case on modern platforms, no change for others. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1856042 13f79535-47bb-0310-9956-ffa450edef68
* Narrow symbolic link detection on NTFSwrowe2019-03-201-1/+2
| | | | | | | | | | | | | | | | | | Read the WIN32_FIND_DATA::dwReserved0 field to determine whether reparse point is a "name surrogate". It's probably more safe to bind to specifig tags. If provided structure (wininfo) was not resulted from FindFile* call, then additional FindFirstFile call is performed. However this may be unnecessary, because the alternate GetFileInformation call is used in the case of an open file handle, and APR_FINFO_LINK has no meaning when it comes to open files. Submitted by: Oleg Liatte <olegliatte gmail.com> git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1855949 13f79535-47bb-0310-9956-ffa450edef68
* Small corrections to if_indextoname resolution on win32, compiles cleanwrowe2019-03-191-1/+1
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1855864 13f79535-47bb-0310-9956-ffa450edef68
* Replace the link-time pragma from r1839494 with APR_DECLARE_LATE_DLL_FUNC wrowe2019-03-191-2/+24
| | | | | | | | resolution of if_indextoname and if_nametoindex. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1855855 13f79535-47bb-0310-9956-ffa450edef68
* Support canon pre-defined macro (gcc, cc and clang) for macOS which is now ↵jim2019-03-141-0/+7
| | | | | | __APPLE__ git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1855558 13f79535-47bb-0310-9956-ffa450edef68
* Follow up to r1854123: add a note about synchronous signals and SIGUSR2.ylavic2019-03-081-0/+7
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1855049 13f79535-47bb-0310-9956-ffa450edef68
* atomic: c89/ansi can use native atomics for builtin and solarisylavic2019-01-171-4/+4
| | | | | | | No asm volatile is used there, so prefer native over mutexes. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1851542 13f79535-47bb-0310-9956-ffa450edef68
* atomics: follow up to r1841078: provide specific initializer for generic 64bitylavic2019-01-171-2/+6
| | | | | | | | | | The can't be two apr_atomic_init(), atomic/mutex64.c shouldn't implement one since generic/mutex implementation may be used by several platforms. So introduce private apr__atomic_generic64_init() and use it where needed. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1851541 13f79535-47bb-0310-9956-ffa450edef68
* Happy New Year 2019rjung2019-01-011-1/+1
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1850087 13f79535-47bb-0310-9956-ffa450edef68
* Add in Atomics for 64bit intsjim2018-09-172-0/+71
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1841078 13f79535-47bb-0310-9956-ffa450edef68