Commit c097d30c authored by Brian Havard's avatar Brian Havard
Browse files

Use ap_canonical_error() where appropriate.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85000 13f79535-47bb-0310-9956-ffa450edef68
parent a2a7de2a
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -195,7 +195,7 @@ static int get_path_info(request_rec *r)
    char *path = r->filename;
    char *end = &path[strlen(path)];
    char *last_cp = NULL;
    int rv;
    int rv, rvc;
#ifdef HAVE_DRIVE_LETTERS
    char bStripSlash=1;
#endif
@@ -286,9 +286,10 @@ static int get_path_info(request_rec *r)
	 * even if they returned an error.
	 */
	r->finfo.protection = 0;
	rvc = ap_canonical_error(rv);

#if defined(APR_ENOENT) && defined(APR_ENOTDIR)
        if (rv == APR_ENOENT || rv == APR_ENOTDIR) {
        if (rvc == APR_ENOENT || rvc == APR_ENOTDIR) {
            last_cp = cp;

            while (--cp > path && *cp != '/')
@@ -299,7 +300,7 @@ static int get_path_info(request_rec *r)
        }
        else {
#if defined(APR_EACCES)
            if (rv != APR_EACCES)
            if (rvc != APR_EACCES)
#endif
                ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
                            "access to %s failed", r->uri);
+13 −10
Original line number Diff line number Diff line
@@ -1147,9 +1147,11 @@ int ap_parse_htaccess(void **result, request_rec *r, int override,
            }
            *result = dc;
            break;
        }
        else if (status != APR_ENOENT && status != APR_ENOTDIR) {
            ap_log_rerror(APLOG_MARK, APLOG_CRIT, errno, r,
        } else {
            ap_status_t cerr = ap_canonical_error(status);

            if (cerr != APR_ENOENT && cerr != APR_ENOTDIR) {
                ap_log_rerror(APLOG_MARK, APLOG_CRIT, status, r,
                              "%s pcfg_openfile: unable to check htaccess file, "
                              "ensure it is readable",
                              filename);
@@ -1159,6 +1161,7 @@ int ap_parse_htaccess(void **result, request_rec *r, int override,
                return HTTP_FORBIDDEN;
            }
        }
    }

/* cache it */
    new = ap_palloc(r->pool, sizeof(struct htaccess_result));
+2 −2
Original line number Diff line number Diff line
@@ -160,7 +160,7 @@ static int get_rfc1413(ap_socket_t *sock, const char *local_ip,
        ap_ssize_t j = strlen(buffer + i);
        ap_status_t status;
	status  = ap_send(sock, buffer+i, &j);
	if (status != APR_SUCCESS && status != APR_EINTR) {
	if (status != APR_SUCCESS && ap_canonical_error(status) != APR_EINTR) {
	    ap_log_error(APLOG_MARK, APLOG_CRIT, status, srv,
		         "write: rfc1413: error sending request");
	    return -1;
@@ -186,7 +186,7 @@ static int get_rfc1413(ap_socket_t *sock, const char *local_ip,
        ap_ssize_t j = sizeof(buffer) - 1 - i;
        ap_status_t status;
	status = ap_recv(sock, buffer+i, &j);
	if (status != APR_SUCCESS && status != APR_EINTR) {
	if (status != APR_SUCCESS && ap_canonical_error(status) != APR_EINTR) {
	    ap_log_error(APLOG_MARK, APLOG_CRIT, status, srv,
			"read: rfc1413: error reading response");
	    return -1;