summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES3
-rw-r--r--network_io/unix/sendrecv.c32
2 files changed, 19 insertions, 16 deletions
diff --git a/CHANGES b/CHANGES
index 2d1038ad6..acea4e466 100644
--- a/CHANGES
+++ b/CHANGES
@@ -17,6 +17,9 @@ Changes for APR 1.1.1
*) find_apr.m4: Try installed APR before bundled copy if --with-apr not
passed to configure. [Justin Erenkrantz]
+ *) Fix issue with poll() followed by net I/O yielding EAGAIN on
+ Mac OS 10.4 (Darwin 8). [Wilfredo Sanchez]
+
Changes for APR 1.1.0
*) Added apr_procattr_user_set and apr_procattr_group_set
diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c
index 03d132385..c5fc43a83 100644
--- a/network_io/unix/sendrecv.c
+++ b/network_io/unix/sendrecv.c
@@ -40,8 +40,8 @@ apr_status_t apr_socket_send(apr_socket_t *sock, const char *buf,
rv = write(sock->socketdes, buf, (*len));
} while (rv == -1 && errno == EINTR);
- if (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK)
- && (sock->timeout > 0)) {
+ while (rv == -1 && (errno == EAGAIN || errno == EWOULDBLOCK)
+ && (sock->timeout > 0)) {
apr_status_t arv;
do_select:
arv = apr_wait_for_io_or_timeout(NULL, sock, 0);
@@ -80,8 +80,8 @@ apr_status_t apr_socket_recv(apr_socket_t *sock, char *buf, apr_size_t *len)
rv = read(sock->socketdes, buf, (*len));
} while (rv == -1 && errno == EINTR);
- if ((rv == -1) && (errno == EAGAIN || errno == EWOULDBLOCK)
- && (sock->timeout > 0)) {
+ while ((rv == -1) && (errno == EAGAIN || errno == EWOULDBLOCK)
+ && (sock->timeout > 0)) {
do_select:
arv = apr_wait_for_io_or_timeout(NULL, sock, 1);
if (arv != APR_SUCCESS) {
@@ -120,8 +120,8 @@ apr_status_t apr_socket_sendto(apr_socket_t *sock, apr_sockaddr_t *where,
where->salen);
} while (rv == -1 && errno == EINTR);
- if ((rv == -1) && (errno == EAGAIN || errno == EWOULDBLOCK)
- && (sock->timeout > 0)) {
+ while ((rv == -1) && (errno == EAGAIN || errno == EWOULDBLOCK)
+ && (sock->timeout > 0)) {
apr_status_t arv = apr_wait_for_io_or_timeout(NULL, sock, 0);
if (arv != APR_SUCCESS) {
*len = 0;
@@ -153,8 +153,8 @@ apr_status_t apr_socket_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock,
(struct sockaddr*)&from->sa, &from->salen);
} while (rv == -1 && errno == EINTR);
- if ((rv == -1) && (errno == EAGAIN || errno == EWOULDBLOCK)
- && (sock->timeout > 0)) {
+ while ((rv == -1) && (errno == EAGAIN || errno == EWOULDBLOCK)
+ && (sock->timeout > 0)) {
apr_status_t arv = apr_wait_for_io_or_timeout(NULL, sock, 1);
if (arv != APR_SUCCESS) {
*len = 0;
@@ -200,8 +200,8 @@ apr_status_t apr_socket_sendv(apr_socket_t * sock, const struct iovec *vec,
rv = writev(sock->socketdes, vec, nvec);
} while (rv == -1 && errno == EINTR);
- if ((rv == -1) && (errno == EAGAIN || errno == EWOULDBLOCK)
- && (sock->timeout > 0)) {
+ while ((rv == -1) && (errno == EAGAIN || errno == EWOULDBLOCK)
+ && (sock->timeout > 0)) {
apr_status_t arv;
do_select:
arv = apr_wait_for_io_or_timeout(NULL, sock, 0);
@@ -316,8 +316,8 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file,
*len); /* number of bytes to send */
} while (rv == -1 && errno == EINTR);
- if ((rv == -1) && (errno == EAGAIN || errno == EWOULDBLOCK)
- && (sock->timeout > 0)) {
+ while ((rv == -1) && (errno == EAGAIN || errno == EWOULDBLOCK)
+ && (sock->timeout > 0)) {
do_select:
arv = apr_wait_for_io_or_timeout(NULL, sock, 0);
if (arv != APR_SUCCESS) {
@@ -626,8 +626,8 @@ apr_status_t apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file,
}
} while (rc == -1 && errno == EINTR);
- if ((rc == -1) && (errno == EAGAIN || errno == EWOULDBLOCK)
- && (sock->timeout > 0)) {
+ while ((rc == -1) && (errno == EAGAIN || errno == EWOULDBLOCK)
+ && (sock->timeout > 0)) {
apr_status_t arv = apr_wait_for_io_or_timeout(NULL, sock, 0);
if (arv != APR_SUCCESS) {
@@ -773,8 +773,8 @@ apr_status_t apr_socket_sendfile(apr_socket_t * sock, apr_file_t * file,
flags); /* flags */
} while (rv == -1 && errno == EINTR);
- if ((rv == -1) && (errno == EAGAIN || errno == EWOULDBLOCK)
- && (sock->timeout > 0)) {
+ while ((rv == -1) && (errno == EAGAIN || errno == EWOULDBLOCK)
+ && (sock->timeout > 0)) {
do_select:
arv = apr_wait_for_io_or_timeout(NULL, sock, 0);
if (arv != APR_SUCCESS) {