Return-Path: Delivered-To: apmail-apache-cvs-archive@apache.org Received: (qmail 2869 invoked by uid 500); 23 Apr 2000 13:22:11 -0000 Mailing-List: contact apache-cvs-help@apache.org; run by ezmlm Precedence: bulk X-No-Archive: yes Reply-To: new-httpd@apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list apache-cvs@apache.org Received: (qmail 2858 invoked by uid 500); 23 Apr 2000 13:22:10 -0000 Delivered-To: apmail-apache-2.0-cvs@apache.org Date: 23 Apr 2000 13:22:09 -0000 Message-ID: <20000423132209.2851.qmail@locus.apache.org> From: trawick@locus.apache.org To: apache-2.0-cvs@apache.org Subject: cvs commit: apache-2.0/src/lib/apr/test ab_apr.c trawick 00/04/23 06:22:09 Modified: src/lib/apr/misc/unix canonerr.c src/main http_protocol.c src/modules/mpm/dexter dexter.c src/modules/mpm/mpmt_pthread mpmt_pthread.c src/lib/apr/test ab_apr.c Log: Fix some problems on systems where EAGAIN != EWOULDBLOCK (e.g., OS/390). ap_canonical_errror() for Unix now maps EWOULDBLOCK to EAGAIN/APR_EAGAIN when appropriate so that the changes here (as well as bjh's changes from a few days ago) to call ap_canonical_error() before comparing with EWOULDBLOCK will work on Unix as well. Revision Changes Path 1.3 +5 -0 apache-2.0/src/lib/apr/misc/unix/canonerr.c Index: canonerr.c =================================================================== RCS file: /home/cvs/apache-2.0/src/lib/apr/misc/unix/canonerr.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- canonerr.c 2000/04/21 05:27:01 1.2 +++ canonerr.c 2000/04/23 13:22:05 1.3 @@ -58,6 +58,11 @@ int ap_canonical_error(ap_status_t errcode) { +#if defined(EAGAIN) && defined(EWOULDBLOCK) && (EAGAIN != EWOULDBLOCK) + if (errcode == EWOULDBLOCK) { + errcode = EAGAIN; + } +#endif return errcode; } 1.65 +1 -1 apache-2.0/src/main/http_protocol.c Index: http_protocol.c =================================================================== RCS file: /home/cvs/apache-2.0/src/main/http_protocol.c,v retrieving revision 1.64 retrieving revision 1.65 diff -u -r1.64 -r1.65 --- http_protocol.c 2000/04/20 16:08:07 1.64 +++ http_protocol.c 2000/04/23 13:22:06 1.65 @@ -2272,7 +2272,7 @@ else if (rv != APR_SUCCESS) { if (r->connection->aborted) break; - else if (rv == EAGAIN) + else if (ap_canonical_error(rv) == APR_EAGAIN) continue; else { ap_log_rerror(APLOG_MARK, APLOG_INFO, rv, r, 1.70 +1 -1 apache-2.0/src/modules/mpm/dexter/dexter.c Index: dexter.c =================================================================== RCS file: /home/cvs/apache-2.0/src/modules/mpm/dexter/dexter.c,v retrieving revision 1.69 retrieving revision 1.70 diff -u -r1.69 -r1.70 --- dexter.c 2000/04/14 15:59:00 1.69 +++ dexter.c 2000/04/23 13:22:07 1.70 @@ -681,7 +681,7 @@ char pipe_read_char; ret = read(listenfds[0].fd, &pipe_read_char, 1); - if (ret == -1 && errno == EAGAIN) { + if (ret == -1 && (errno == EAGAIN || errno == EWOULDBLOCK)) { /* It lost the lottery. It must continue to suffer * through a life of servitude. */ } 1.64 +1 -1 apache-2.0/src/modules/mpm/mpmt_pthread/mpmt_pthread.c Index: mpmt_pthread.c =================================================================== RCS file: /home/cvs/apache-2.0/src/modules/mpm/mpmt_pthread/mpmt_pthread.c,v retrieving revision 1.63 retrieving revision 1.64 diff -u -r1.63 -r1.64 --- mpmt_pthread.c 2000/04/14 15:59:02 1.63 +++ mpmt_pthread.c 2000/04/23 13:22:08 1.64 @@ -637,7 +637,7 @@ int n=1; ret = ap_recv(listensocks[0], &pipe_read_char, &n); - if (ret == APR_EAGAIN) { + if (ap_canonical_error(ret) == APR_EAGAIN) { /* It lost the lottery. It must continue to suffer * through a life of servitude. */ } 1.26 +2 -2 apache-2.0/src/lib/apr/test/ab_apr.c Index: ab_apr.c =================================================================== RCS file: /home/cvs/apache-2.0/src/lib/apr/test/ab_apr.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- ab_apr.c 2000/04/20 02:03:12 1.25 +++ ab_apr.c 2000/04/23 13:22:08 1.26 @@ -535,13 +535,13 @@ r = sizeof(buffer); ap_setsocketopt(c->aprsock, APR_SO_TIMEOUT, aprtimeout); status = ap_recv(c->aprsock, buffer, &r); - if (r == 0 || (status != 0 && status != EAGAIN)) { + if (r == 0 || (status != 0 && ap_canonical_error(status) != EAGAIN)) { good++; close_connection(c); return; } - if (status == EAGAIN) + if (ap_canonical_error(status) == EAGAIN) return; c->read += r;