diff options
-rw-r--r-- | network_io/unix/sendrecv.c | 4 | ||||
-rw-r--r-- | network_io/unix/sockopt.c | 3 |
2 files changed, 7 insertions, 0 deletions
diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index 6d9a0ce8e..628bbaa43 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -169,6 +169,10 @@ ap_status_t ap_recv(struct socket_t *sock, char *buf, ap_ssize_t *len) } while (rv == -1 && errno == EINTR); } } + else if (rv == -1 && errno == EAGAIN && sock->timeout == 0) { + (*len) = 0; + return errno; + } (*len) = rv; return APR_SUCCESS; } diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index 4ad020e8d..4d2b912f5 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -176,6 +176,9 @@ ap_status_t ap_setsocketopt(struct socket_t *sock, ap_int32_t opt, ap_int32_t on } if (opt & APR_SO_TIMEOUT) { sock->timeout = on; + if ((stat = sononblock(sock->socketdes)) != APR_SUCCESS) { + return stat; + } } return APR_SUCCESS; } |