diff options
author | peter <peter@FreeBSD.org> | 2013-07-28 06:02:40 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2013-07-28 06:02:40 +0000 |
commit | 0aadc82afbae4dbc41da86cd4f9b2ceb8ddcb17d (patch) | |
tree | 6a96e078c28ea05d418b4e2722bc03b0b930a78b /contrib/apr/network_io/unix/sendrecv.c | |
parent | 7594fa5c70305cda65deedc5cc7e08dc037727cd (diff) | |
parent | b910f82d487cf989800adbd1a65b3a7f71b46277 (diff) | |
download | FreeBSD-src-0aadc82afbae4dbc41da86cd4f9b2ceb8ddcb17d.zip FreeBSD-src-0aadc82afbae4dbc41da86cd4f9b2ceb8ddcb17d.tar.gz |
Update subversion-1.8.0 -> 1.8.1. Update supporting
components: apr-1.4.6 -> 1.4.8 and apr-util-1.4.1 -> 1.5.2.
This is a post point-zero bug-fix / fix-sharp-edges release, including
some workarounds for UTF-8 for people who haven't yet turned on WITH_ICONV.
Diffstat (limited to 'contrib/apr/network_io/unix/sendrecv.c')
-rw-r--r-- | contrib/apr/network_io/unix/sendrecv.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/contrib/apr/network_io/unix/sendrecv.c b/contrib/apr/network_io/unix/sendrecv.c index c133a26..6b14643 100644 --- a/contrib/apr/network_io/unix/sendrecv.c +++ b/contrib/apr/network_io/unix/sendrecv.c @@ -174,7 +174,14 @@ apr_status_t apr_socket_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock, return errno; } - apr_sockaddr_vars_set(from, from->sa.sin.sin_family, ntohs(from->sa.sin.sin_port)); + /* + * Check if we have a valid address. recvfrom() with MSG_PEEK may return + * success without filling in the address. + */ + if (from->salen > APR_OFFSETOF(struct sockaddr_in, sin_port)) { + apr_sockaddr_vars_set(from, from->sa.sin.sin_family, + ntohs(from->sa.sin.sin_port)); + } (*len) = rv; if (rv == 0 && sock->type == SOCK_STREAM) { @@ -245,7 +252,7 @@ do_select: /* Define a structure to pass in when we have a NULL header value */ static apr_hdtr_t no_hdtr; -#if defined(__linux__) && defined(HAVE_WRITEV) +#if (defined(__linux__) || defined(__GNU__)) && defined(HAVE_WRITEV) apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, apr_hdtr_t *hdtr, apr_off_t *offset, @@ -285,9 +292,6 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, hdtr = &no_hdtr; } - /* Ignore flags for now. */ - flags = 0; - if (hdtr->numheaders > 0) { apr_size_t hdrbytes; |