Return-Path: Delivered-To: apmail-apr-cvs-archive@apr.apache.org Received: (qmail 85337 invoked by uid 500); 9 Oct 2001 05:21:04 -0000 Mailing-List: contact cvs-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Reply-To: dev@apr.apache.org Delivered-To: mailing list cvs@apr.apache.org Received: (qmail 85325 invoked by uid 500); 9 Oct 2001 05:21:04 -0000 Delivered-To: apmail-apr-util-cvs@apache.org Date: 9 Oct 2001 05:17:18 -0000 Message-ID: <20011009051718.30892.qmail@icarus.apache.org> From: jerenkrantz@apache.org To: apr-util-cvs@apache.org Subject: cvs commit: apr-util/buckets apr_buckets_socket.c X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N 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) {