| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
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@1905386 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
| |
overflow when apr_size_t is 32-bit long.
* network_io/win32/sendrecv.c
(apr_socket_sendv): As above.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1904734 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
WSABUFs and error out on theoretical cases that cannot be handled with a
single WSASend().
WSASend() returns the NumberOfBytesSent as DWORD, so the previous code
that splitted overflowing iovecs never worked, as the total number of sent
bytes cannot be properly represented by the API. So let's maintain a 1:1
relationship between the iovecs and WSABUFs, and error out on all inputs
that exceed MAXDWORD.
* network_io/win32/sendrecv.c
(apr_socket_sendv): Remove the code that splits iovecs into WSABUFs.
Check the sizes of all iovecs and the total size.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1904715 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
| |
Shortlog:
- r1902312: apr_socket_sendv: WIN32: Limit the number of WSABUFs allocated
for a single call.
- r1904699: apr_socket_sendv: WIN32: Follow up to r1902312: Avoid short writes.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1904714 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We possibly (edge cases) can't send an entire iovec array in a single WSASend()
call because structs WSABUF and iovec are ABI incompatible.
To avoid breaking users that rely on full-write by apr_socket_sendv(), which
supposedly is guaranteed by WSASend(), repeat the call until the given iovec
array is exhausted.
There is no way to provide both full-write and atomicity guarantees for
apr_socket_sendv() on Windows, so we choose the former..
* include/apr_network_io.h:
Document apr_socket_sendv() full-write/atomicity (non-)guarantees above the
system ones.
* network_io/win32/sendrecv.c(apr_socket_sendv):
Change to a loop on WSASend() when needed, taking care of its API limits
w.r.t. the given struct iovec.
[Reverted by r1904714]
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1904699 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902583 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
| |
Rather than precomputing requested_len before writev() and later comparing with
what has been sent, we can walk the iovec after only to see if it's exhausted.
This saves useless precomputation on error (e.g. nonblocking EAGAIN) and avoids
a poteential invalid/overflowed requested_len should the iovec point to more
than SIZE_MAX bytes.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902314 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
call.
* network_io/win32/sendrecv.c():
Define WSABUF_ON_HEAP to 500.
* network_io/win32/sendrecv.c(apr_socket_sendv):
Do not sendv more than WSABUF_ON_HEAP WSABUFs.
[Reverted by r1904714]
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902312 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
| |
Rework win32 poll wakeup implementation:
- Explicitly use apr_socket_t instead of apr_file_t for wakeup `pipe`
- 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.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1897895 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
| |
Return APR_ENOSPC if returned buf is truncated for an AF_UNIX.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1896956 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1895508 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If pipe writers (wakeup) put a single byte until it's consumed by the
reader (drain), it's enough to use an atomic cas for the writers (still) and
an atomic (re)set for the reader (no more cas here).
This requires that the reader never blocks on read though (e.g. spurious return
from poll), so make the read side on the pipe non-blocking again/finally.
Since synchronous non-blocking read is not a thing for Windows' Readfile(), add
a ->socket flag to this arch's 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
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1883742 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
| |
For unix sockets, return the path (sun_path).
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1883728 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
documentation [1] TF_USE_KERNEL_APC is the most performant option:
[[[
Directs the driver to use kernel asynchronous procedure calls (APCs)
instead of worker threads to process long TransmitFile requests.
Long TransmitFile requests are defined as requests that require more
than a single read from the file or a cache; the request therefore
depends on the size of the file and the specified length of the send
packet.
Use of TF_USE_KERNEL_APC can deliver significant performance benefits.
It is possible (though unlikely), however, that the thread in which
context TransmitFile is initiated is being used for heavy computations;
this situation may prevent APCs from launching.
]]]
The downside is not applicable for our use case since calling thread
is not busy and waiting for operation completion.
[1] https://docs.microsoft.com/en-gb/windows/win32/api/mswsock/nf-mswsock-transmitfile
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1866934 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
TransmitFile() should not be used directly and pointer to function should
retrieved using WSAIoctl:
https://docs.microsoft.com/en-gb/windows/win32/api/mswsock/nf-mswsock-transmitfile#remarks
* network_io/win32/sendrecv.c
(apr_socket_sendfile): Retrieve pointer to TransmitFile using WSAIoctl.
* CMakeLists.txt
(APR_SYSTEM_LIBS): Remove reference to mswsock.lib.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1866932 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
| |
(apr_socket_sendfile): Remove Windows 95 compatibility code.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1866928 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
socket and only then marking it as non-inheritable.
This protects against a potential socket handle leak in case of certain race
conditions.
See also:
https://support.microsoft.com/en-us/help/2398202/an-application-may-stop-responding-when-the-application-closes-a-socke
* network_io/win32/sockets.c
(apr_socket_create): Use the WSA_FLAG_NO_HANDLE_INHERITED when supported by
the OS.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1861073 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1861043 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1855864 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
| |
it is wrapped in a very odd way on Windows, both the includes
and required libraries. Using a pragma to create a link time
resolution for the required lib is simplest.
Submitted by: jeking3
https://github.com/apache/apr/pull/7/commits/1fb97b8bd0b02fe71945b03986f3c69fb4270b6b
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1839493 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
| |
for an address which is not link-local.
* include/apr_network_io.h: Document the above.
* test/testsock.c (test_zone): Test for that.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1816628 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* network_io/unix/sockaddr.c (apr_sockaddr_zone_set,
apr_sockaddr_zone_get): New functions.
(apr_sockaddr_ip_getbuf): Append %scope for link-local address.
(apr_sockaddr_equal): Compare link-local address with different
scopes as not equal.
* include/apr_network_io.h: Add function declarations.
* configure.in: Test for if_indextoname and if_nametoindex.
* test/testsock.c (test_zone): New test case.
* include/arch/win32/apr_private.h: Assume Windows supports
if_nametoindex and if_indextoname.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1816527 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
| |
scope id parsing introduced in r1683521.
* test/testipsub.c (test_parse_addr_port): New function.
Submitted by: rjung, jorton
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1813286 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
| |
string.
* test/testipsub.c: Test that calling apr_ipsubnet_create with the
empty string fails.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1808039 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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: http://svn.apache.org/repos/asf/apr/apr/trunk@1805309 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Be accurate (and consistent accross unixes) with the returned number of bytes
written (note that it is possible for both bytes to be sent and an error to be
returned, due to headers and trailers handling).
Fix some returned errno vs apr_status_t in some error paths.
Fix BSDs nonblocking/busy retry on EAGAIN when nothing is written.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1789257 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1789249 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
| |
for APR_SO_FREEBIND on FreeBSD.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1733594 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
| |
* network_io/unix/sockopt.c (apr_socket_opt_set): Implement
APR_SO_FREEBIND on Linux with IP_FREEBIND
* test/testsock.c (test_freebind): Add test case.
Submitted by: Ashley GC, jkaluza, jorton
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1733451 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
| |
One cannot assume that sin6_addr is located at the start of sa_data.
For example, glibc puts sin6_flowinfo there.
Fix by casting to the proper type first.
Reported by Andre Naujoks <nautsch2 gmail com> via
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=759534
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1696140 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
| |
apr_pstrmemdup, no functional change.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1683521 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
| |
apr_socket_accept() cases.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1667916 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
| |
returning IPv4 addresses if any IPv6 addresses were returned.
[Eric Covener]
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1634615 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
| |
apr_sockaddr_t into a specified pool.
Submitted by: Yann Ylavic <ylavic.dev gmail.com>
Reviewed by: trawick
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1587045 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
on FreeBSD 10 which was introduced with APR 1.5.0 through an unlikely
mechanism:
* FreeBSD 10 introduced accept4(). APR uses accept4() where it can find it.
accept4() on Linux and FreeBSD 10 both have a SOCK_NONBLOCK flag, but on
FreeBSD 10 the SOCK_NONBLOCK is the sole determiner of whether or not the
connected socket is non-blocking.
* clang is normally used on FreeBSD 10.
* APR's configure-time check for inherited O_NONBLOCK didn't work with clang,
so initially the lack of inheritance across accept4() wasn't a problem.
* APR 1.5.0 allowed the configure-time check to work with clang, exposing
the bad expectation about accept4() matching the accept() behavior.
With FreeBSD accept4() (avail in 10+), O_NONBLOCK is not inherited
(unlike Linux). Mimic the accept() behavior here in a way that
may help other platforms as well.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1551659 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
| |
Use the new code required for OS X/Darwin on the other platforms too.
(IOW, we're willing to peek in the socket as long as APR_POLLIN is
returned, regardless of other flags.)
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1543056 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
| |
test for equality fails. Instead, just check for the bit.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1543033 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1541061 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
| |
forget that non-blocking is enabled
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1523615 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
| |
non-blocking socket + poll. When a socket is non-
blocking and a timeout is set, the non-blocking
state must be disabled.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1523384 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
| |
handling IPv4 options introduced in r1309386.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1487796 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
| |
- getaddrinfo() returned only useless entries
- getaddrinfo() returned EAI_SYSTEM but errno == 0
- gethostbyname() returns no error but an empty address list
Submitted by: Jan Kaluža <jkaluza redhat com>, Stefan Fritsch
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1478905 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
| |
(Linux sendfile has no flags, anyway)
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1460179 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1438958 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
| |
to the same value as before.
Use apr_cpystrn().
PR: 37863 (warning message from Apache httpd during restart)
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1406690 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
| |
when testing a v4 subnet against a v6 address.
* test/testipsub.c (test_interesting_subnets): Add test.
PR: 54047
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1405985 13f79535-47bb-0310-9956-ffa450edef68
|