(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;
}
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
* 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 != '/')
}
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
while (cp > path && cp[-1] == '/')
--cp;
-#endif /* ENOENT && ENOTDIR */
+#endif /* APR_ENOENT && APR_ENOTDIR */
}
return OK;
}
*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",
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. */
}
srv = apr_poll(pollset, &n, -1);
if (srv != APR_SUCCESS) {
- if (apr_canonical_error(srv) == APR_EINTR) {
+ if (APR_STATUS_IS_EINTR(srv)) {
continue;
}
/* 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");
}
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. */
}
srv = apr_poll(pollset, &n, -1);
if (srv != APR_SUCCESS) {
- if (apr_canonical_error(srv) == APR_EINTR) {
+ if (APR_STATUS_IS_EINTR(srv)) {
continue;
}
/* 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");
}
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. */
}
ret = apr_poll(pollset, &n, -1);
if (ret != APR_SUCCESS) {
- if (apr_canonical_error(ret) == APR_EINTR) {
+ if (APR_STATUS_IS_EINTR(ret)) {
continue;
}
/* 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++;
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. */
}
srv = apr_poll(pollset, &n, -1);
if (srv != APR_SUCCESS) {
- if (apr_canonical_error(srv) == APR_EINTR) {
+ if (APR_STATUS_IS_EINTR(srv)) {
continue;
}
/* 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");
}
#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
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;
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;
}
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;
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;
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("<p>\n");
- printf(" This is ApacheBench, Version %s <i><%s></i> apache-2.0<br>\n", AB_VERSION, "$Revision: 1.27 $");
+ printf(" This is ApacheBench, Version %s <i><%s></i> apache-2.0<br>\n", AB_VERSION, "$Revision: 1.28 $");
printf(" Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/<br>\n");
printf(" Copyright (c) 1998-2000 The Apache Software Foundation, http://www.apache.org/<br>\n");
printf("</p>\n<p>\n");