Return-Path: Delivered-To: apmail-apr-cvs-archive@apr.apache.org Received: (qmail 93309 invoked by uid 500); 15 Jul 2002 22:18:08 -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 93296 invoked by uid 500); 15 Jul 2002 22:18:08 -0000 Delivered-To: apmail-apr-util-cvs@apache.org Date: 15 Jul 2002 22:18:06 -0000 Message-ID: <20020715221806.57321.qmail@icarus.apache.org> From: bnicholes@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 bnicholes 2002/07/15 15:18:06 Modified: buckets apr_buckets_socket.c Log: Fixed socket_bucket_read so that it only set the socket to nonblocking mode if it isn't already.Otherwise it messes up the timeout value that may have been intentionally set by the upstream application. This matches the same change that was made in pipe_bucket_read. Revision Changes Path 1.42 +6 -1 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.41 retrieving revision 1.42 diff -u -r1.41 -r1.42 --- apr_buckets_socket.c 15 Jul 2002 07:56:13 -0000 1.41 +++ apr_buckets_socket.c 15 Jul 2002 22:18:06 -0000 1.42 @@ -64,7 +64,12 @@ if (block == APR_NONBLOCK_READ) { apr_socket_timeout_get(p, &timeout); - apr_socket_timeout_set(p, 0); + /* Only mess with the timeout if we are in a blocking state + * otherwise we are already nonblocking so don't worry about it. + */ + if (timeout < 0) { + apr_socket_timeout_set(p, 0); + } } *str = NULL;