| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix the inheritance of the non-blocking option across apr_socket_accept()
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/branches/1.5.x@1551672 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Follow up to r1543033:
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.)
Submitted by: trawick
Reviewed/backported by: jim
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.5.x@1543057 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
| |
OSX (Darwin) returns APR_POLLHUP|APR_POLLIN, so the
test for equality fails. Instead, just check for the bit.
Reviewed/backported by: jim
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.5.x@1543034 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
| |
add apr_sockaddr_is_wildcard() API
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.5.x@1541078 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
restructure Windows apr_socket_connect() to more closely match
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: http://svn.apache.org/repos/asf/apr/apr/branches/1.5.x@1536167 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
| |
fix extra "the" in comments and license text
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.5.x@1534109 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
| |
On Windows, a socket timeout isn't implemented with
non-blocking socket + poll. When a socket is non-
blocking and a timeout is set, the non-blocking
state must be disabled.
(plus the subsequent fix to adjust the socket state)
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.5.x@1531094 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
| |
return apr_get_netos_error() when setsockopt() fails
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.5.x@1531093 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
| |
* network_io/unix/multicast.c (do_mcast_opt): Fix regression in
handling IPv4 options introduced in r1309386.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.5.x@1487797 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
| |
fix warning: parameter 'flags' set but not used
(Linux sendfile has no flags, anyway)
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.5.x@1478924 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
| |
Only fill in apr_sockaddr_vars_set if we have valid data
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.5.x@1478918 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
| |
Make sure apr_sockaddr_info_get() returns an error if
- 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/branches/1.5.x@1478909 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
| |
* network_io/unix/sockaddr.c (apr_ipsubnet_test): Fix false positive
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/branches/1.5.x@1420111 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
| |
apr_socket_accept_filter: Return success when trying to again set the filter
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/branches/1.5.x@1406693 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
| |
add apr_socket_accept_filter() notes on the name and args parameters,
which should have been declared as const char *
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.5.x@1405403 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
| |
Guard against EAI_ADDRFAMILY not being defined, it seems to be glibc
specific
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.5.x@1343244 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Improve handling of AI_ADDRCONFIG with getaddrinfo()
Using AI_ADDRCONFIG involves some unfortunate guesswork because it does not
consider loopback addresses when trying to determine if IPv4 or IPv6 is
configured (RFC 3493).
This is a problem if one actually wants to listen on or connect to the loopback
address of a protocol family that is not otherwise configured on the system.
Also, some implementations (glibc, cough) behave strangely if no other
addresses besides 127.0.0.1 and ::1 are configured.
A real fix would enhance apr_sockaddr_info_get's interface to allow the caller
to specify if he wants to use the address for listen() or connect(), and if he
wants to make the result dependant on the presence of non-loopback addresses.
Then apr_sockaddr_info_get could pass the right combination of AI_ADDRCONFIG
and AI_PASSIVE to getaddrinfo().
As a workaround, retry getaddrinfo() without AI_ADDRCONFIG in case of
EAI_ADDRFAMILY. This solves the most common problems but not all corner cases.
PR: 52709
Submitted by: Nirgal Vourgère <jmv_deb nirgal com>, Stefan Fritsch
Many thanks also to Aurelien Jarno for helping to debug this.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.5.x@1343236 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
| |
If we retry getaddrinfo() without AI_ADDRCONFIG, we should really only remove
AI_ADDRCONFIG and not all flags.
When the retry logic was added in r64571, this was equivalent because not
other flags were set. But this has changed since then.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.5.x@1343234 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
| |
Hurd's sendfile works like Linux's
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.5.x@1340471 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.5.x@1309412 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
| |
Add support for APR_SO_BROADCAST
PR: 46389
Submitted by: Armin Müller <mueller itestra com>
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.5.x@1183717 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
IPV6_V6ONLY on Windows:
* 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: http://svn.apache.org/repos/asf/apr/apr/branches/1.5.x@1091824 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
| |
Windows: Save a call to getpeername() when trying to retrieve the
remote address of a socket created by apr_socket_accept()
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.5.x@1088568 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
| |
* network_io/unix/sockets.c (apr_socket_accept): Ensure the correct
address family is used for the new socket when adjusting
local_addr/remote_addr, fixing handling of an AF_INET socket
accepted from a bound AF_INET6 socket.
PR: 49678
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.5.x@1084669 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
use apr_get_netos_error() to retrieve the getaddrinfo() error
code on Windows
before:
error: 681001/APR does not understand this error code
after:
error: 731001/No such host is known.
(the latter matches an IPv4-only build)
Submitted by: Ivan Zhakov <ivan visualsvn.com>
Reviewed by: trawick
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.5.x@1083933 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
| |
to resolve some gcc warnings and dead code on Windows
(the testlfsabi change from r1083183 is omitted, as the testcases
aren't in this branch)
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.5.x@1083869 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
| |
axe unused variables
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.5.x@1083803 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
apr_sockaddr_info_get() on AIX: Fix a problem which could set
the port field in the native socket address to 1 when 0 was
specified.
An AIX-specific hack to work around a service name limitation
used "1" as the service name, but the 1 was not replaced later.
PR: 46964
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.5.x@1081121 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.5.x@1080106 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* network_io/unix/sockets.c (apr_socket_connect): Copy the remote
address by value rather than by reference. This ensures that the
sockaddr object returned by apr_socket_addr_get is allocated from
the same pool as the socket object itself, as apr_socket_accept
does; avoiding any potential lifetime mismatches.
* test/testsock.c (test_get_addr): Enhance test case to cover this.
PR: 49713
Submitted by: jorton
Reviewed by: rpluem
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.5.x@987532 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix apr_socket_addr_get() in combination with async connects, for the APR_LOCAL
case. Before it would return 0.0.0.0:0, instead of the actual local address/port.
TODO: Fix win32 in a similar fashion; though maybe it's better to assume the
local address is unknown by default...
* network_io/unix/sockets.c
(apr_socket_connect): Move address determination, or rather
determining that the local address is unknown, to before returning
because of e.g. EINPROGRESS.
Submitted by: striker
Reviewed by: rpluem
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.5.x@987524 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
| |
* Add missing APR_DECLARE for apr_socket_atreadeof
Submitted by: rpluem
Reviewed by: rpluem
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.4.x@835759 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
| |
Set file/socket descriptor to -1 before close(), so that there is no chance
of returning an already closed FD from apr_os_file_get()/apr_os_sock_get().
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.4.x@831642 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add apr_socket_is_connected to detect whether the remote side of a socket
is still open. The origin of apr_socket_is_connected is r473278 from
http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/proxy_util.c
in httpd.
* Improve the documentation
Suggested by: jorton
* Improve the documentation even further
Reviewed by: jim
* include/apr_network_io.h,
* network_io/unix/socket_util.c (apr_socket_atreadeof): Renamed from
apr_socket_is_connected; adjusted to return an apr_status_t error
code, and pass an "at EOF" flag via an output parameter.
* test/testsock.c (test_atreadeof): Renamed from test_is_connected,
adjusted for new API.
Reviewed by: jorton, rpluem
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.4.x@826089 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
from the trunk.
Set CLOEXEC flags where appropriate. Either use new O_CLOEXEC flag and
associated functions, such as dup3(), accept4(), epoll_create1() etc., or
simply set CLOEXEC flag using fcntl().
Patch by Stefan Fritsch <sf sfritsch.de> and
Arkadiusz Miskiewicz <arekm pld-linux.org>.
PR 46425.
fix unused variable warning for builds without HAVE_DUP3
Unroll APR_SET_FD_CLOEXEC macro.
* One missing unroll of APR_SET_FD_CLOEXEC.
Document CLOEXEC patch.
Only set CLOEXEC on dup() if both NOCLEANUP and INHERIT flags are clear.
Retain the INHERIT/NOCLEANUP flags of new_file in apr_file_dup2().
Patch by Stefan Fritsch <sf sfritsch.de>.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.4.x@783970 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
| |
Fix compilation error on systems that do not have IPV6.
Patch by Julien Charbon <jch 4js.com>.
PR 46601.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.4.x@746117 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
| |
apr_socket_sendfile() on Solaris: Fix handling of files truncated
after the sender determines the length. (This fixes a busy loop in
httpd when a file being served is truncated.)
Some other implementations of apr_socket_sendfile() were already
patched along the way to handle this; some apparently remain broken.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.4.x@739754 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
| |
Caveats:
- no idea if IBM's proprietary OSes actually have thread-safe
version of getservbyname() function, just assumed that by looking at
other similar functions being marked safe in APR detection code
- works on Linux (Fedora 9, i.e. glibc2)
Use thread safe versions of getservbyname().
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@661178 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
| |
Return APR_ENOENT if we cannot find service, errno is undefined.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@660405 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
First, remove extra code. Secondly, don't update len and
offset within this loop; we just want to check for errors
and finally:
When using a socket marked for non-blocking I/O, sendfile() may send fewer bytes than requested. In
this case, the number of bytes successfully sent is returned in the via the len parameters and the
error EAGAIN is returned.
so when this happens, return with a success anytime we've
sent data.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@656659 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
| |
means we just worry about the footers.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@656355 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
| |
go ahead and use apr_socket_sendv(), which handles things
much more cleanly, keeping the sendfile() stuff nicely
contained. Yes, this is similar to how the Linux impl
does it :)
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@654788 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@654251 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@654247 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@654185 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
to host byte order.
PR 44903.
Submitted by: Chris Taylor <ctaylor wadeford.plus.com>
Reviewed by: trawick
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@652951 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@652692 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
| |
to the sendfile/tr..iovec series, tallying these correctly.
Submitted by: Geoff Greer <angryparsley mipsisrisc.com> and wrowe
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@652690 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
| |
Submitted by: Geoff Greer <angryparsley mipsisrisc.com>]
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@651651 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
| |
hdtr iovecs.
Submitted by: Geoff Greer <angryparsley mipsisrisc.com>
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@651395 13f79535-47bb-0310-9956-ffa450edef68
|