Return-Path: Delivered-To: apmail-apache-cvs-archive@apache.org Received: (qmail 95215 invoked by uid 500); 5 Oct 2000 17:33:34 -0000 Mailing-List: contact apache-cvs-help@apache.org; run by ezmlm Precedence: bulk Reply-To: new-httpd@apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list apache-cvs@apache.org Received: (qmail 95189 invoked by uid 500); 5 Oct 2000 17:33:29 -0000 Delivered-To: apmail-apache-2.0-cvs@apache.org Date: 5 Oct 2000 17:33:23 -0000 Message-ID: <20001005173323.95153.qmail@locus.apache.org> From: wrowe@locus.apache.org To: apache-2.0-cvs@apache.org Subject: cvs commit: apache-2.0/src CHANGES wrowe 00/10/05 10:33:21 Modified: src/lib/apr/test testsf.c src/lib/apr/threadproc/os2 proc.c src/main buff.c http_config.c http_protocol.c http_request.c mpm_common.c rfc1413.c src/modules/mpm/dexter dexter.c src/modules/mpm/mpmt_pthread mpmt_pthread.c src/modules/mpm/perchild perchild.c src/support ab.c src CHANGES Log: The lots of little ones... APR_IS_STATUS_condition(rv) conditional macros replacing the majority of fallible rv == APR_condition tests. But there are lots more to fix, these are the obvious ones that already did proper canonical error conversion. Revision Changes Path 1.9 +2 -2 apache-2.0/src/lib/apr/test/testsf.c Index: testsf.c =================================================================== RCS file: /home/cvs/apache-2.0/src/lib/apr/test/testsf.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- testsf.c 2000/09/12 23:15:36 1.8 +++ testsf.c 2000/10/05 17:32:39 1.9 @@ -350,7 +350,7 @@ rv = apr_sendfile(sock, f, &hdtr, ¤t_file_offset, &tmplen, 0); printf("apr_sendfile()->%d, sent %ld bytes\n", rv, (long)tmplen); if (rv) { - if (apr_canonical_error(rv) == APR_EAGAIN) { + if (APR_STATUS_IS_EAGAIN(rv)) { nsocks = 1; tmprv = apr_poll(pfd, &nsocks, -1); assert(!tmprv); @@ -417,7 +417,7 @@ } while (total_bytes_sent < expected_len && (rv == APR_SUCCESS || - apr_canonical_error(rv) == APR_EAGAIN)); + APR_STATUS_IS_EAGAIN(rv))); if (total_bytes_sent != expected_len) { fprintf(stderr, "client problem: sent %ld of %ld bytes\n", 1.31 +1 -1 apache-2.0/src/lib/apr/threadproc/os2/proc.c Index: proc.c =================================================================== RCS file: /home/cvs/apache-2.0/src/lib/apr/threadproc/os2/proc.c,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- proc.c 2000/08/06 16:35:56 1.30 +++ proc.c 2000/10/05 17:32:44 1.31 @@ -350,7 +350,7 @@ } else if (stricmp(extension, ".exe") != 0) { status = apr_open(&progfile, progname, APR_READ|APR_BUFFERED, 0, cont); - if (status != APR_SUCCESS && apr_canonical_error(status) == APR_ENOENT) { + if (status != APR_SUCCESS && APR_STATUS_IS_ENOENT(status)) { progname = apr_pstrcat(cont, progname, ".exe", NULL); } 1.63 +4 -4 apache-2.0/src/main/buff.c Index: buff.c =================================================================== RCS file: /home/cvs/apache-2.0/src/main/buff.c,v retrieving revision 1.62 retrieving revision 1.63 diff -u -r1.62 -r1.63 --- buff.c 2000/09/10 20:45:16 1.62 +++ buff.c 2000/10/05 17:32:49 1.63 @@ -391,7 +391,7 @@ /* we'll read the next packet if it's available */ fb->inptr = fb->inbase; rv = saferead(fb, fb->inptr, fb->bufsiz, &fb->incnt); - if (rv != APR_SUCCESS && apr_canonical_error(rv) != APR_EAGAIN) { + if (rv != APR_SUCCESS && !APR_STATUS_IS_EAGAIN(rv)) { fb->berrno = rv; fb->saved_errno = rv; doerror(fb, B_RD); @@ -419,7 +419,7 @@ else if (rv != APR_SUCCESS) { fb->berrno = rv; fb->saved_errno = rv; - if (apr_canonical_error(rv) != APR_EAGAIN) { + if (!APR_STATUS_IS_EAGAIN(rv)) { doerror(fb, B_RD); } } @@ -694,7 +694,7 @@ if (rv != APR_SUCCESS) { /* ### set berrno? */ fb->saved_errno = rv; - if (apr_canonical_error(rv) != APR_EAGAIN) { + if (!APR_STATUS_IS_EAGAIN(rv)) { doerror(fb, B_WR); } } @@ -828,7 +828,7 @@ if (rv != APR_SUCCESS) { /* ### set berrno? */ fb->saved_errno = rv; - if (apr_canonical_error(rv) != APR_EAGAIN) { + if (!APR_STATUS_IS_EAGAIN(rv)) { doerror(fb, B_WR); } } 1.78 +1 -3 apache-2.0/src/main/http_config.c Index: http_config.c =================================================================== RCS file: /home/cvs/apache-2.0/src/main/http_config.c,v retrieving revision 1.77 retrieving revision 1.78 diff -u -r1.77 -r1.78 --- http_config.c 2000/09/20 17:35:59 1.77 +++ http_config.c 2000/10/05 17:32:50 1.78 @@ -1447,9 +1447,7 @@ *result = dc; break; } else { - apr_status_t cerr = apr_canonical_error(status); - - if (cerr != APR_ENOENT && cerr != APR_ENOTDIR) { + if (!APR_STATUS_IS_ENOENT(status) && !APR_STATUS_IS_ENOTDIR(status)) { ap_log_rerror(APLOG_MARK, APLOG_CRIT, status, r, "%s pcfg_openfile: unable to check htaccess file, " "ensure it is readable", 1.144 +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.143 retrieving revision 1.144 diff -u -r1.143 -r1.144 --- http_protocol.c 2000/10/05 16:55:08 1.143 +++ http_protocol.c 2000/10/05 17:32:51 1.144 @@ -2709,7 +2709,7 @@ (void) ap_rflush(r); break; } - else if (apr_canonical_error(read_rv) != APR_EAGAIN) { + else if (!APR_STATUS_IS_EAGAIN(read_rv)) { r->connection->aborted = 1; break; } 1.55 +5 -6 apache-2.0/src/main/http_request.c Index: http_request.c =================================================================== RCS file: /home/cvs/apache-2.0/src/main/http_request.c,v retrieving revision 1.54 retrieving revision 1.55 diff -u -r1.54 -r1.55 --- http_request.c 2000/10/05 16:55:09 1.54 +++ http_request.c 2000/10/05 17:32:52 1.55 @@ -210,7 +210,7 @@ char *path = r->filename; char *end = &path[strlen(path)]; char *last_cp = NULL; - int rv, rvc; + int rv; #ifdef HAVE_DRIVE_LETTERS char bStripSlash=1; #endif @@ -301,10 +301,9 @@ * even if they returned an error. */ r->finfo.protection = 0; - rvc = apr_canonical_error(rv); #if defined(APR_ENOENT) && defined(APR_ENOTDIR) - if (rvc == APR_ENOENT || rvc == APR_ENOTDIR) { + if (APR_STATUS_IS_ENOENT(rv) || APR_STATUS_IS_ENOTDIR(rv)) { last_cp = cp; while (--cp > path && *cp != '/') @@ -315,14 +314,14 @@ } else { #if defined(APR_EACCES) - if (rvc != APR_EACCES) + if (APR_STATUS_IS_EACCES(rv)) #endif ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, "access to %s failed", r->uri); return HTTP_FORBIDDEN; } #else -#error ENOENT || ENOTDIR not defined; please see the +#error APR_ENOENT || APR_ENOTDIR not defined; please see the #error comments at this line in the source for a workaround. /* * If ENOENT || ENOTDIR is not defined in one of the your OS's @@ -344,7 +343,7 @@ while (cp > path && cp[-1] == '/') --cp; -#endif /* ENOENT && ENOTDIR */ +#endif /* APR_ENOENT && APR_ENOTDIR */ } return OK; } 1.34 +2 -2 apache-2.0/src/main/mpm_common.c Index: mpm_common.c =================================================================== RCS file: /home/cvs/apache-2.0/src/main/mpm_common.c,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- mpm_common.c 2000/08/22 15:09:24 1.33 +++ mpm_common.c 2000/10/05 17:32:53 1.34 @@ -191,11 +191,11 @@ #endif } rv = apr_wait_all_procs(ret, status, APR_NOWAIT, p); - if (apr_canonical_error(rv) == APR_EINTR) { + if (APR_STATUS_IS_EINTR(rv)) { ret->pid = -1; return; } - if (rv == APR_CHILD_DONE) { + if (APR_STATUS_IS_CHILD_DONE(rv)) { return; } #ifdef NEED_WAITPID 1.22 +2 -2 apache-2.0/src/main/rfc1413.c Index: rfc1413.c =================================================================== RCS file: /home/cvs/apache-2.0/src/main/rfc1413.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- rfc1413.c 2000/08/07 19:26:00 1.21 +++ rfc1413.c 2000/10/05 17:32:53 1.22 @@ -168,7 +168,7 @@ apr_ssize_t j = strlen(buffer + i); apr_status_t status; status = apr_send(sock, buffer+i, &j); - if (status != APR_SUCCESS && apr_canonical_error(status) != APR_EINTR) { + if (status != APR_SUCCESS && !APR_STATUS_IS_EINTR(status)) { ap_log_error(APLOG_MARK, APLOG_CRIT, status, srv, "write: rfc1413: error sending request"); return -1; @@ -194,7 +194,7 @@ apr_ssize_t j = sizeof(buffer) - 1 - i; apr_status_t status; status = apr_recv(sock, buffer+i, &j); - if (status != APR_SUCCESS && apr_canonical_error(status) != APR_EINTR) { + if (status != APR_SUCCESS && !APR_STATUS_IS_EINTR(status)) { ap_log_error(APLOG_MARK, APLOG_CRIT, status, srv, "read: rfc1413: error reading response"); return -1; 1.126 +3 -3 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.125 retrieving revision 1.126 diff -u -r1.125 -r1.126 --- dexter.c 2000/08/23 00:01:53 1.125 +++ dexter.c 2000/10/05 17:33:03 1.126 @@ -481,7 +481,7 @@ apr_ssize_t n = 1; ret = apr_recv(listenfds[0], &pipe_read_char, &n); - if (apr_canonical_error(ret) == APR_EAGAIN) { + if (APR_STATUS_IS_EAGAIN(ret)) { /* It lost the lottery. It must continue to suffer * through a life of servitude. */ } @@ -555,7 +555,7 @@ srv = apr_poll(pollset, &n, -1); if (srv != APR_SUCCESS) { - if (apr_canonical_error(srv) == APR_EINTR) { + if (APR_STATUS_IS_EINTR(srv)) { continue; } @@ -1112,7 +1112,7 @@ /* give the children the signal to die */ for (i = 0; i < num_daemons;) { if ((rv = apr_write(pipe_of_death_out, &char_of_death, &one)) != APR_SUCCESS) { - if (apr_canonical_error(rv) == APR_EINTR) continue; + if (APR_STATUS_IS_EINTR(rv)) continue; ap_log_error(APLOG_MARK, APLOG_WARNING, rv, ap_server_conf, "write pipe_of_death"); } 1.121 +3 -3 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.120 retrieving revision 1.121 diff -u -r1.120 -r1.121 --- mpmt_pthread.c 2000/08/23 00:01:54 1.120 +++ mpmt_pthread.c 2000/10/05 17:33:07 1.121 @@ -432,7 +432,7 @@ apr_ssize_t n = 1; ret = apr_recv(listensocks[0], &pipe_read_char, &n); - if (apr_canonical_error(ret) == APR_EAGAIN) { + if (APR_STATUS_IS_EAGAIN(ret)) { /* It lost the lottery. It must continue to suffer * through a life of servitude. */ } @@ -498,7 +498,7 @@ ret = apr_poll(pollset, &n, -1); if (ret != APR_SUCCESS) { - if (apr_canonical_error(ret) == APR_EINTR) { + if (APR_STATUS_IS_EINTR(ret)) { continue; } @@ -1133,7 +1133,7 @@ /* give the children the signal to die */ for (i = 0; i < ap_daemons_limit;) { if ((rv = apr_write(pipe_of_death_in, &char_of_death, &one)) != APR_SUCCESS) { - if (apr_canonical_error(rv) == APR_EINTR) continue; + if (APR_STATUS_IS_EINTR(rv)) continue; ap_log_error(APLOG_MARK, APLOG_WARNING, rv, ap_server_conf, "write pipe_of_death"); } i++; 1.21 +3 -3 apache-2.0/src/modules/mpm/perchild/perchild.c Index: perchild.c =================================================================== RCS file: /home/cvs/apache-2.0/src/modules/mpm/perchild/perchild.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- perchild.c 2000/08/23 00:01:55 1.20 +++ perchild.c 2000/10/05 17:33:11 1.21 @@ -518,7 +518,7 @@ apr_ssize_t n = 1; ret = apr_recv(listenfds[0], &pipe_read_char, &n); - if (apr_canonical_error(ret) == APR_EAGAIN) { + if (APR_STATUS_IS_EAGAIN(ret)) { /* It lost the lottery. It must continue to suffer * through a life of servitude. */ } @@ -593,7 +593,7 @@ srv = apr_poll(pollset, &n, -1); if (srv != APR_SUCCESS) { - if (apr_canonical_error(srv) == APR_EINTR) { + if (APR_STATUS_IS_EINTR(srv)) { continue; } @@ -1272,7 +1272,7 @@ /* give the children the signal to die */ for (i = 0; i < num_daemons;) { if ((rv = apr_write(pipe_of_death_out, &char_of_death, &one)) != APR_SUCCESS) { - if (apr_canonical_error(rv) == APR_EINTR) continue; + if (APR_STATUS_IS_EINTR(rv)) continue; ap_log_error(APLOG_MARK, APLOG_WARNING, rv, ap_server_conf, "write pipe_of_death"); } 1.28 +5 -5 apache-2.0/src/support/ab.c Index: ab.c =================================================================== RCS file: /home/cvs/apache-2.0/src/support/ab.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- ab.c 2000/09/14 18:42:58 1.27 +++ ab.c 2000/10/05 17:33:14 1.28 @@ -498,7 +498,7 @@ } c->start = apr_now(); if ((rv = apr_connect(c->aprsock, hostname)) != APR_SUCCESS) { - if (apr_canonical_error(rv) == APR_EINPROGRESS) { + if (APR_STATUS_IS_EINPROGRESS(rv)) { c->state = STATE_CONNECTING; apr_add_poll_socket(readbits, c->aprsock, APR_POLLOUT); return; @@ -574,13 +574,13 @@ r = sizeof(buffer); apr_setsocketopt(c->aprsock, APR_SO_TIMEOUT, aprtimeout); status = apr_recv(c->aprsock, buffer, &r); - if (r == 0 || (status != 0 && apr_canonical_error(status) != APR_EAGAIN)) { + if (r == 0 || (status != APR_SUCCESS && !APR_STATUS_IS_EAGAIN(status))) { good++; close_connection(c); return; } - if (apr_canonical_error(status) == APR_EAGAIN) + if (APR_STATUS_IS_EAGAIN(status)) return; c->read += r; @@ -862,14 +862,14 @@ static void copyright(void) { if (!use_html) { - printf("This is ApacheBench, Version %s\n", AB_VERSION " <$Revision: 1.27 $> apache-2.0"); + printf("This is ApacheBench, Version %s\n", AB_VERSION " <$Revision: 1.28 $> apache-2.0"); printf("Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/\n"); printf("Copyright (c) 1998-2000 The Apache Software Foundation, http://www.apache.org/\n"); printf("\n"); } else { printf("

\n"); - printf(" This is ApacheBench, Version %s <%s> apache-2.0
\n", AB_VERSION, "$Revision: 1.27 $"); + printf(" This is ApacheBench, Version %s <%s> apache-2.0
\n", AB_VERSION, "$Revision: 1.28 $"); printf(" Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
\n"); printf(" Copyright (c) 1998-2000 The Apache Software Foundation, http://www.apache.org/
\n"); printf("

\n

\n"); 1.251 +3 -0 apache-2.0/src/CHANGES Index: CHANGES =================================================================== RCS file: /home/cvs/apache-2.0/src/CHANGES,v retrieving revision 1.250 retrieving revision 1.251 diff -u -r1.250 -r1.251 --- CHANGES 2000/10/05 12:01:52 1.250 +++ CHANGES 2000/10/05 17:33:19 1.251 @@ -1,4 +1,7 @@ Changes with Apache 2.0a7 + *) Added APR_IS_STATUS_condition test macros to eliminate canonical error + conversions. [William Rowe] + *) Now that we have ap_add_input_filter(), rename ap_add_filter() to ap_add_output_filter(). [Jeff Trawick]