| 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
|
|
|
|
|
|
|
|
|
|
| |
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.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1904699 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.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902312 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
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1895508 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: https://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: https://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: https://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: https://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: https://svn.apache.org/repos/asf/apr/apr/trunk@1861073 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1861043 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: https://svn.apache.org/repos/asf/apr/apr/trunk@1805309 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
| |
forget that non-blocking is enabled
git-svn-id: https://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: https://svn.apache.org/repos/asf/apr/apr/trunk@1523384 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
| |
PR: 46389
Submitted by: Armin Müller <mueller itestra com>
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1183693 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Deal with SDKs which don't have the symbol definition
* Deal with old run-time platforms which don't implement the option
and have hard-coded behavior internally (option always on)
Behavior changes:
run on Windows >= Vista, SDK has IPV6_V6ONLY:
no change in behavior
run on Windows >= Vista, SDK doesn't have IPV6_V6ONLY:
works just like SDK had the def'n (will return APR_SUCCESS on
IPv6 socket instead of WSAENOPROTOOPT)
run on Windows < Vista, regardless of SDK:
socket_opt_get/set(APR_IPV6_V6ONLY) reflect stack behavior (always on)
previously, if IPV6_V6ONLY was defined: set returned WSAENOPROTOOPT
previously, if IPV6_V6ONLY was not defined: set returned APR_ENOTIMPL
previously, regardless of IPV6_V6ONLY presence: get returned not-enabled
now: get always returns enabled; set returns APR_SUCCESS when enabling,
APR_ENOTIMPL when trying to disable
PR: 45321
Submitted by: Sob <sob hisoftware.cz>
Tweaked by: trawick
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1091757 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
| |
the Unix implementation, fixing the getpeername() optimization
and WSAEISCONN behavior
PR: 48736 (covered WSAISCONN issue)
Submitted by: <inoue ariel-networks.com> (WSAISCONN handling)
Reworked/extended by: trawick
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1089031 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
| |
remote address of a socket created by apr_socket_accept()
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1088352 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1088103 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1083169 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1081495 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@991753 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@982038 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@949209 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
| |
Enhance the test introduced by Joe in 467600 to also invert
the original IP structure as an IPv6 entity for IPv4 tests,
if IPv6 is present. I settled on a test IP which Win32 just
happens to tollerate if an IPv6 adapter isn't present.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@584885 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
| |
and realized this else combined with WCE is an oddball.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@569536 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
| |
works fine if enabled (testsockets passes). Modifes the #if's so the
Win9x code path is also used for WinCE.
PR: 39859
Submitted by: Curt Arnold <carnold apache.org>
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@543286 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
| |
Solves a bug on Win 2000 where AcceptEx inhibits the proper
behavior of getpeername.
PR: 41321
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@494531 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
| |
Reviewed by wrowe and jorton
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@480212 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@428317 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@428313 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Submitted by: Anthony Minessale <anthmct@yahoo.com>
PR: 39325
* network_io/win32/sendrecv.c
(apr_socket_recvfrom): Fill in from->port.
* network_io/unix/sendrecv.c
(apr_socket_recvfrom): Ditto.
* network_io/beos/sendrecv.c
(apr_socket_recvfrom): Ditto.
* test/testsockets.c
(sendto_recievefrom): Zero out the port before calling recvfrom, to
confirm that it's filled in.
* CHANGES: Note change.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@397344 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
| |
apr_socket_send()
Submitted by: Chris Demetriou <c.g.demetriou gmail.com>
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@374924 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
| |
PR: 32177
Submitted by: Sim <sgobbi datamanagement.it>, Jeff Trawick
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@190576 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
| |
There is no functional change except changing stuct
mamber from cntxt to pool to be able to use the
ACCESSOR macros.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@190305 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@151412 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@125552 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65354 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65340 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
| |
#ifdef'ed
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65291 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65288 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
| |
PR: 28471
Submitted by: inoue <inoue ariel-networks.com>
Reviewed by: Jeff Trawick
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65108 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
| |
must set the option cache if we're setting APR_IPV6_V6ONLY. Otherwise,
later apr_socket_opt_get calls will fail.
This fixes Listen directives on IPv6 machines where IPV6_V6ONLY may be
enabled (i.e. FreeBSD 5.x, OpenBSD, NetBSD) where it would not properly
bind to the IPv4 socket.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65034 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64904 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
| |
of the socket.
Submitted by: Philippe M. Chiasson <gozer cpan.org>
Reviewed by: trawick
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64801 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
| |
various tests with (sock->timeout > 0).
Also mop up some very hard to read statements by liberally
applying parens.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64778 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64770 13f79535-47bb-0310-9956-ffa450edef68
|