| Commit message (Collapse) | Author | Age |
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1918296 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
| |
default unless APR_FULL_BLOCK was used; unconditionally set the
blocking state later. Saves two syscalls per invocation for both
APR_READ_BLOCK and APR_WRITE_BLOCK, no [intended] functional change.
Github: closes #56
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1918258 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* configure.in: Test for working pipe2().
* file_io/unix/pipe.c (file_pipe_create): Use pipe2(,O_NONBLOCK) if
APR_FULL_NONBLOCK is requested.
* test/testpipe.c (nonblock_pipe): New test.
Github: closes #55
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1917641 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
| |
Sumitted by: @296995966 on github.
Github: closes #42
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1916276 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
APR_FOPEN_APPEND).
While this change fixed an issue where Windows and Unix reported different
offsets after opening files for append, it also caused a regression: for
files opened with APR_FOPEN_APPEND | APR_FOPEN_BUFFERED, flushing their
contents would cause the contents to be written at offset 0, rather than
appended.
This happens because flushes and regular writes use different code paths.
And while regular writes guarantee that an append will happen to the end of
the file, a buffer flush uses a regular WriteFile(), assuming the file pointer
has been properly set before.
To fix both issues, we'd probably need to rework this part and make all
writes use the same approach. But for now let's revert this change to fix
the regression, that was also reported in [1].
I'll add a regression test for this problem separately.
[1] https://lists.apache.org/thread/56gnyc3tc0orjh5mfsqo9gpq1br59b01
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1909088 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1905414 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902600 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
| |
* file_io/win32/filestat.c
(more_finfo): Remove code to handle MORE_OF_FSPEC.
* include/arch/win32/apr_arch_file_io.h
(MORE_OF_FSPEC): Remove.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902014 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove code in win32 apr_file_t implementation that emulates working with
sockets as files. Sockets on Windows are not kernel objects and should be
used only via Winsock API.
* file_io/win32/readwrite.c
(): Do not include apr_arch_networkio.h.
(read_with_timeout): Remove APR_FILETYPE_SOCKET support code.
* include/arch/win32/apr_arch_file_io.h
(apr_filetype_e): Remove APR_FILETYPE_SOCKET enum value.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/win32-pollset-wakeup-no-file-socket-emulation@1897254 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
| |
Windows: Use term `socket_pipe` instead for `file_socket_pipe` for internal
poll wakeup socket API. Move implementation to network_io/win32/socket_pipe.c
from file_io/win32/pipe.c.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/win32-pollset-wakeup-no-file-socket-emulation@1897246 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Set socket nonblocking mode for socket using apr_socket_timeout_set().
Patch by: ylavic
* file_io/win32/pipe.c
(create_socket_pipe): Remove code to set SOCKET to nonblocking mode.
(apr_file_socket_pipe_create): Set IN socket to nonblocking mode.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/win32-pollset-wakeup-no-file-socket-emulation@1897245 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Windows: For the pollset wakeup, use apr_socket_t directly instead of using a
socket disguised as an apr_file_t.
* file_io/win32/pipe.c
(): Include apr_arch_networkio.h.
(socket_pipe_cleanup, apr_file_socket_pipe_create,
apr_file_socket_pipe_close): Update to use apr_socket_t instead of apr_file_t.
* include/arch/unix/apr_arch_poll_private.h
(WAKEUP_USES_PIPE): New #define to specify mechanism used for pollset wakeup.
(apr_pollset_t, apr_pollcb_t): Add wakeup_socket if not WAKEUP_USES_PIPE.
(apr_poll_create_wakeup_socket, apr_poll_close_wakeup_socket,
apr_poll_drain_wakeup_socket): Declare if not WAKEUP_USES_PIPE.
* include/arch/win32/apr_arch_file_io.h
(apr_file_socket_pipe_create, apr_file_socket_pipe_close): Update to use
apr_socket_t instead of apr_file_t.
* poll/unix/poll.c
(impl_pollset_add): Remove hack that allows apr_file_t even if
APR_FILES_AS_SOCKETS == 0.
(impl_pollset_poll, impl_pollcb_poll): Use wakeup_pipe or wakeup_socket
depending of WAKEUP_USES_PIPE.
* poll/unix/pollcb.c
(pollcb_cleanup, apr_pollcb_create_ex, apr_pollcb_wakeup): Use wakeup_pipe
or wakeup_socket depending of WAKEUP_USES_PIPE.
* poll/unix/pollset.c
(pollset_cleanup, apr_pollset_create_ex, apr_pollset_wakeup): Use wakeup_pipe
or wakeup_socket depending of WAKEUP_USES_PIPE.
* poll/unix/select.c
(impl_pollset_add): Remove hack that allows apr_file_t even if
APR_FILES_AS_SOCKETS == 0.
(impl_pollset_poll): Use wakeup_pipe or wakeup_socket depending of
WAKEUP_USES_PIPE.
* poll/unix/wakeup.c
(apr_poll_create_wakeup_pipe): Rename to apr_poll_create_wakeup_socket()
on Windows and use apr_socket_t instead of apr_file_t.
(apr_poll_close_wakeup_pipe): Rename to apr_poll_close_wakeup_socket()
on Windows and use apr_socket_t instead of apr_file_t.
(apr_poll_drain_wakeup_socket): New.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/win32-pollset-wakeup-no-file-socket-emulation@1897208 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
| |
* file_io/win32/filestat.c
(reparse_point_is_link, apr_stat): Use FindFirstFileExW(FindExInfoBasic)
instead of FindFirstFileW().
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1896724 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
| |
(reparse_point_is_link): Cast to more correct type.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1896721 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
| |
(apr_stat): Remove unused union member.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1896720 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1896719 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
symlink detection added in r1855949 (PR47630) [1].
See [2] for the detailed problem report and discussion.
The code before this patch performs FindFirstFile() whenever
APR_FINFO_LINK is passed. This is problematic for at least two reasons:
1) Any attempt to detect if the root is a symlink now fails because
FindFirstFile() cannot be called for the root directory
2) Any check that includes the APR_FINFO_LINK flag now calls FindFirstFile(),
which essentially is a "readdir". Previously, ordinary files could have
been processed with a much cheaper call to GetFileAttributesEx().
In other words, there is a significant performance penalty for
stat(... | APR_FINFO_LINK) in a common case.
Fix this by postponing a call to FindFirstFile() until we actually need the
file tag information to resolve the reparse point.
[1] https://bz.apache.org/bugzilla/show_bug.cgi?id=47630
[2] https://lists.apache.org/thread/18x2jb81nf6zrjsnwf1k2wwooprkp0p5
* file_io/win32/filestat.c
(apr_stat): Call FindFirstFile() only when asking for the true name with
APR_FINFO_NAME. Adjust the related check.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1896717 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1896626 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
| |
* file_io/win32/filestat.c
(apr_file_info_get): Inline fillin_fileinfo() to apr_file_info_get().
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1896625 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
| |
* file_io/win32/filestat.c
(apr_file_mtime_set): Pass NULL as ATIME and CTIME when calling SetFileTime()
to prevent changing ATIME and CTIME instead of retrieving these times using
GetFileTime().
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1896623 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1895516 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1895512 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1895511 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1895510 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1895508 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1895465 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1895181 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1895179 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1895178 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1895177 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If pipe writers (wakeup) put a single byte until consume it's consumed by the
reader (drain), an atomic cas for the writers (still) and an atomic (re)set
for the reader is enough (not need to cas on the reader side).
This requires that the reader never blocks on read though (e.g. spurious return
from poll), so (re)make the read side on the pipe non-blocking (finally).
Since synchronous non-blocking read is not a thing for Windows' Readfile(), add
a ->socket flag this arch's to apr_file_t (like the existing ->pipe one) which
file_socket_pipe_create() will set to make apr_file_read/write() handle
non-blocking (nor overlapped) socket pipes with WSARecv/Send().
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1895175 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
file_bucket_setaside().
apr_file_setasidea() needs to invalidate the old file descriptor per semantics:
* @remark After calling this function, old_file may not be used
So to avoid the setaside issue with splitted file buckets, file_bucket_setaside()
will now apr_file_dup() instead of apr_file_setaside() when the bucket is shared
(i.e. refcount > 1).
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1893445 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
| |
There is no cleanup with APR_FOPEN_NOCLEANUP, so apr_pool_cleanup_kill() can
go in the !(old_file->flags & APR_FOPEN_NOCLEANUP) block.
The file descriptor can't be invalidated either, the file may be split in
multiple buckets and setting aside one shouldn't invalidate the others.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1893204 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
| |
by the file descriptor, filesystem or underlying device.
See, e.g.: https://github.com/vim/vim/pull/4025
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1883340 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
| |
Coverity warnings from ignored lseek() return value in ->buffered
handling.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1878343 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
apr_os_file_put() adds no cleanup so it forces APR_FOPEN_NOCLEANUP, but when
apr_file_mktemp() adds the cleanup implicitely (unless the user specifies
APR_FOPEN_NOCLEANUP explicitely), it needs to clear APR_FOPEN_NOCLEANUP for
the resulting file.
Note: Without this fix, a file created with apr_file_mktemp() and later
passed to apr_file_setaside(), or within a file bucket passed to
apr_bucket_setaside(), will leak both the fd and inode because
the cleanup gets dropped (e.g. httpd's BZ 64452).
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1878279 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
| |
Even when the path is first identified as a wildcard path.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1872893 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
msgid: <CABw-3YcK0qbeYWDOwE684XtBj3rCT2CuVOBWWqda4gMtRyRJEw@mail.gmail.com>
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1866019 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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: https://svn.apache.org/repos/asf/apr/apr/trunk@1862435 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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: https://svn.apache.org/repos/asf/apr/apr/trunk@1862071 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
| |
of which_dup to help static analysers.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1862068 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1861263 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
| |
(apr_read_dir): Remove duplicate local variable declaration.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1860750 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
| |
(apr_read_dir): Remove Windows Vista compatibility code.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1860749 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
| |
(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: https://svn.apache.org/repos/asf/apr/apr/trunk@1860748 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
| |
wanted is more than APR_FINFO_MIN.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1860747 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1860745 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
provided event to non-signaled state automatically [1]. Using automatic reset
events is not recommended:
[[[
Functions such as ReadFile and WriteFile set this handle to the nonsignaled
state before they begin an I/O operation. When the operation has completed,
the handle is set to the signaled state.
Functions such as GetOverlappedResult and the synchronization wait functions
reset auto-reset events to the nonsignaled state. Therefore, you should use a
manual reset event; if you use an auto-reset event, your application can stop
responding if you wait for the operation to complete and then call
GetOverlappedResult with the bWait parameter set to TRUE.
]]]
[1] https://docs.microsoft.com/en-gb/windows/desktop/api/minwinbase/ns-minwinbase-_overlapped
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1860110 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
| |
(read_with_timeout): Reduce local variable scope.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1860109 13f79535-47bb-0310-9956-ffa450edef68
|