diff --git a/modules/http/http_protocol.c b/modules/http/http_protocol.c index 2b39f05613..645459e056 100644 --- a/modules/http/http_protocol.c +++ b/modules/http/http_protocol.c @@ -2709,7 +2709,7 @@ API_EXPORT(long) ap_send_fb_length(BUFF *fb, request_rec *r, long length) (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; } diff --git a/modules/http/http_request.c b/modules/http/http_request.c index 7b86159165..fb1ab0e663 100644 --- a/modules/http/http_request.c +++ b/modules/http/http_request.c @@ -210,7 +210,7 @@ static int get_path_info(request_rec *r) 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 @@ static int get_path_info(request_rec *r) * 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 @@ static int get_path_info(request_rec *r) } 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 @@ static int get_path_info(request_rec *r) while (cp > path && cp[-1] == '/') --cp; -#endif /* ENOENT && ENOTDIR */ +#endif /* APR_ENOENT && APR_ENOTDIR */ } return OK; } diff --git a/server/config.c b/server/config.c index b1a3d8982d..f965592cc0 100644 --- a/server/config.c +++ b/server/config.c @@ -1447,9 +1447,7 @@ int ap_parse_htaccess(void **result, request_rec *r, int override, *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", diff --git a/server/mpm/dexter/dexter.c b/server/mpm/dexter/dexter.c index e844fed028..006435c8cc 100644 --- a/server/mpm/dexter/dexter.c +++ b/server/mpm/dexter/dexter.c @@ -481,7 +481,7 @@ static void check_pipe_of_death(void) 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 @@ static void *worker_thread(void *arg) 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 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s) /* 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"); } diff --git a/server/mpm/experimental/perchild/perchild.c b/server/mpm/experimental/perchild/perchild.c index 8775d6bd5e..f62b737873 100644 --- a/server/mpm/experimental/perchild/perchild.c +++ b/server/mpm/experimental/perchild/perchild.c @@ -518,7 +518,7 @@ static void check_pipe_of_death(void) 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 @@ static void *worker_thread(void *arg) 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 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s) /* 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"); } diff --git a/server/mpm/mpmt_pthread/mpmt_pthread.c b/server/mpm/mpmt_pthread/mpmt_pthread.c index 79da49018c..c3c2652850 100644 --- a/server/mpm/mpmt_pthread/mpmt_pthread.c +++ b/server/mpm/mpmt_pthread/mpmt_pthread.c @@ -432,7 +432,7 @@ static void check_pipe_of_death(void) 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 @@ static void * worker_thread(void * dummy) 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 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s) /* 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++; diff --git a/server/mpm/perchild/perchild.c b/server/mpm/perchild/perchild.c index 8775d6bd5e..f62b737873 100644 --- a/server/mpm/perchild/perchild.c +++ b/server/mpm/perchild/perchild.c @@ -518,7 +518,7 @@ static void check_pipe_of_death(void) 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 @@ static void *worker_thread(void *arg) 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 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s) /* 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"); } diff --git a/server/mpm_common.c b/server/mpm_common.c index d77c662440..e9e2727e84 100644 --- a/server/mpm_common.c +++ b/server/mpm_common.c @@ -191,11 +191,11 @@ void ap_wait_or_timeout(apr_wait_t *status, apr_proc_t *ret, apr_pool_t *p) #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 diff --git a/server/rfc1413.c b/server/rfc1413.c index ce1758ff9d..7a8cc102f6 100644 --- a/server/rfc1413.c +++ b/server/rfc1413.c @@ -168,7 +168,7 @@ static int get_rfc1413(apr_socket_t *sock, const char *local_ip, 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 @@ static int get_rfc1413(apr_socket_t *sock, const char *local_ip, 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; diff --git a/support/ab.c b/support/ab.c index 688c456866..9752ec042d 100644 --- a/support/ab.c +++ b/support/ab.c @@ -498,7 +498,7 @@ static void start_connect(struct connection *c) } 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 @@ static void read_connection(struct connection *c) 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 test(void) 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");