jerenkrantz 01/10/08 22:17:18
Modified: buckets apr_buckets_socket.c
Log:
On a non-blocking socket, we may receive EAGAIN from read.
Previously, we would treat that as a fatal error. Now, return a zero-length
bucket by letting us fall down to the *len<=0 case.
Revision Changes Path
1.32 +6 -0 apr-util/buckets/apr_buckets_socket.c
Index: apr_buckets_socket.c
===================================================================
RCS file: /home/cvs/apr-util/buckets/apr_buckets_socket.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- apr_buckets_socket.c 2001/09/29 07:06:19 1.31
+++ apr_buckets_socket.c 2001/10/09 05:17:18 1.32
@@ -76,6 +76,12 @@
if (block == APR_NONBLOCK_READ) {
apr_setsocketopt(p, APR_SO_TIMEOUT, timeout);
+ /* There was nothing to read right now, so treat it as okay and
+ * return a 0-length brigade (see below). */
+ if (APR_STATUS_IS_EAGAIN(rv)) {
+ *len = 0;
+ rv = APR_SUCCESS;
+ }
}
if (rv != APR_SUCCESS && rv != APR_EOF) {