Commit f6183803 authored by Stefan Fritsch's avatar Stefan Fritsch
Browse files

Remove more log message prefixes that are now redundant as the

the error log format includes the module name.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1208110 13f79535-47bb-0310-9956-ffa450edef68
parent ac36b13c
Loading
Loading
Loading
Loading
+34 −35
Changes for modules/aaa/mod_auth_digest.c: 34 added lines, 35 removed lines.
Original line number Diff line number Diff line
@@ -201,7 +201,7 @@ module AP_MODULE_DECLARE_DATA auth_digest_module;
static apr_status_t cleanup_tables(void *not_used)
{
    ap_log_error(APLOG_MARK, APLOG_INFO, 0, NULL,
                  "Digest: cleaning up shared memory");
                  "cleaning up shared memory");

    if (client_rmm) {
        apr_rmm_destroy(client_rmm);
@@ -231,7 +231,7 @@ static apr_status_t initialize_secret(server_rec *s)
    apr_status_t status;

    ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, s,
                 "Digest: generating secret for digest authentication ...");
                 "generating secret for digest authentication ...");

#if APR_HAS_RANDOM
    status = apr_generate_random_bytes(secret, sizeof(secret));
@@ -242,12 +242,12 @@ static apr_status_t initialize_secret(server_rec *s)
    if (status != APR_SUCCESS) {
        char buf[120];
        ap_log_error(APLOG_MARK, APLOG_CRIT, status, s,
                     "Digest: error generating secret: %s",
                     "error generating secret: %s",
                     apr_strerror(status, buf, sizeof(buf)));
        return status;
    }

    ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, "Digest: done");
    ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, "done");

    return APR_SUCCESS;
}
@@ -255,7 +255,7 @@ static apr_status_t initialize_secret(server_rec *s)
static void log_error_and_cleanup(char *msg, apr_status_t sts, server_rec *s)
{
    ap_log_error(APLOG_MARK, APLOG_ERR, sts, s,
                 "Digest: %s - all nonce-count checking, one-time nonces, and "
                 "%s - all nonce-count checking, one-time nonces, and "
                 "MD5-sess algorithm disabled", msg);

    cleanup_tables(NULL);
@@ -672,7 +672,7 @@ static const char *set_shmem_size(cmd_parms *cmd, void *config,
        num_buckets = 1;
    }
    ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, cmd->server,
                 "Digest: Set shmem-size: %" APR_SIZE_T_FMT ", num-buckets: %ld",
                 "Set shmem-size: %" APR_SIZE_T_FMT ", num-buckets: %ld",
                 shmem_size, num_buckets);

    return NULL;
@@ -861,7 +861,7 @@ static client_entry *add_client(unsigned long key, client_entry *info,
    if (!entry) {
        long num_removed = gc();
        ap_log_error(APLOG_MARK, APLOG_INFO, 0, s,
                     "Digest: gc'd %ld client entries. Total new clients: "
                     "gc'd %ld client entries. Total new clients: "
                     "%ld; Total removed clients: %ld; Total renewed clients: "
                     "%ld", num_removed,
                     client_list->num_created - client_list->num_renewed,
@@ -1145,8 +1145,7 @@ static client_entry *gen_client(const request_rec *r)

    if (!(entry = add_client(op, &new_entry, r->server))) {
        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                      "Digest: failed to allocate client entry - ignoring "
                      "client");
                      "failed to allocate client entry - ignoring client");
        return NULL;
    }

@@ -1466,7 +1465,7 @@ static int check_nc(const request_rec *r, const digest_header_rec *resp,
    if (conf->check_nc && !client_shm) {
        /* Shouldn't happen, but just in case... */
        ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r,
                      "Digest: cannot check nonce count without shared memory");
                      "cannot check nonce count without shared memory");
        return OK;
    }

@@ -1480,7 +1479,7 @@ static int check_nc(const request_rec *r, const digest_header_rec *resp,
        /* qop is none, client must not send a nonce count */
        if (snc != NULL) {
            ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                          "Digest: invalid nc %s received - no nonce count allowed when qop=none",
                          "invalid nc %s received - no nonce count allowed when qop=none",
                          snc);
            return !OK;
        }
@@ -1491,7 +1490,7 @@ static int check_nc(const request_rec *r, const digest_header_rec *resp,
    nc = strtol(snc, &endptr, 16);
    if (endptr < (snc+strlen(snc)) && !apr_isspace(*endptr)) {
        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                      "Digest: invalid nc %s received - not a number", snc);
                      "invalid nc %s received - not a number", snc);
        return !OK;
    }

@@ -1501,7 +1500,7 @@ static int check_nc(const request_rec *r, const digest_header_rec *resp,

    if (nc != resp->client->nonce_count) {
        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                      "Digest: Warning, possible replay attack: nonce-count "
                      "Warning, possible replay attack: nonce-count "
                      "check failed: %lu != %lu", nc,
                      resp->client->nonce_count);
        return !OK;
@@ -1519,7 +1518,7 @@ static int check_nonce(request_rec *r, digest_header_rec *resp,

    if (strlen(resp->nonce) != NONCE_LEN) {
        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                      "Digest: invalid nonce %s received - length is not %d",
                      "invalid nonce %s received - length is not %d",
                      resp->nonce, NONCE_LEN);
        note_digest_auth_failure(r, conf, resp, 1);
        return HTTP_UNAUTHORIZED;
@@ -1534,7 +1533,7 @@ static int check_nonce(request_rec *r, digest_header_rec *resp,

    if (strcmp(hash, resp->nonce+NONCE_TIME_LEN)) {
        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                      "Digest: invalid nonce %s received - hash is not %s",
                      "invalid nonce %s received - hash is not %s",
                      resp->nonce, hash);
        note_digest_auth_failure(r, conf, resp, 1);
        return HTTP_UNAUTHORIZED;
@@ -1543,7 +1542,7 @@ static int check_nonce(request_rec *r, digest_header_rec *resp,
    dt = r->request_time - nonce_time.time;
    if (conf->nonce_lifetime > 0 && dt < 0) {
        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                      "Digest: invalid nonce %s received - user attempted "
                      "invalid nonce %s received - user attempted "
                      "time travel", resp->nonce);
        note_digest_auth_failure(r, conf, resp, 1);
        return HTTP_UNAUTHORIZED;
@@ -1552,7 +1551,7 @@ static int check_nonce(request_rec *r, digest_header_rec *resp,
    if (conf->nonce_lifetime > 0) {
        if (dt > conf->nonce_lifetime) {
            ap_log_rerror(APLOG_MARK, APLOG_INFO, 0,r,
                          "Digest: user %s: nonce expired (%.2f seconds old "
                          "user %s: nonce expired (%.2f seconds old "
                          "- max lifetime %.2f) - sending new nonce",
                          r->user, (double)apr_time_sec(dt),
                          (double)apr_time_sec(conf->nonce_lifetime));
@@ -1563,7 +1562,7 @@ static int check_nonce(request_rec *r, digest_header_rec *resp,
    else if (conf->nonce_lifetime == 0 && resp->client) {
        if (memcmp(resp->client->last_nonce, resp->nonce, NONCE_LEN)) {
            ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r,
                          "Digest: user %s: one-time-nonce mismatch - sending "
                          "user %s: one-time-nonce mismatch - sending "
                          "new nonce", r->user);
            note_digest_auth_failure(r, conf, resp, 1);
            return HTTP_UNAUTHORIZED;
@@ -1699,7 +1698,7 @@ static int authenticate_digest_user(request_rec *r)

    if (!ap_auth_name(r)) {
        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                      "Digest: need AuthName: %s", r->uri);
                      "need AuthName: %s", r->uri);
        return HTTP_INTERNAL_SERVER_ERROR;
    }

@@ -1729,12 +1728,12 @@ static int authenticate_digest_user(request_rec *r)
    if (resp->auth_hdr_sts != VALID) {
        if (resp->auth_hdr_sts == NOT_DIGEST) {
            ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                          "Digest: client used wrong authentication scheme "
                          "`%s': %s", resp->scheme, r->uri);
                          "client used wrong authentication scheme `%s': %s",
                          resp->scheme, r->uri);
        }
        else if (resp->auth_hdr_sts == INVALID) {
            ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                          "Digest: missing user, realm, nonce, uri, digest, "
                          "missing user, realm, nonce, uri, digest, "
                          "cnonce, or nonce_count in authorization header: %s",
                          r->uri);
        }
@@ -1757,7 +1756,7 @@ static int authenticate_digest_user(request_rec *r)
        copy_uri_components(&r_uri, resp->psd_request_uri, r);
        if (apr_uri_parse(r->pool, resp->uri, &d_uri) != APR_SUCCESS) {
            ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                          "Digest: invalid uri <%s> in Authorization header",
                          "invalid uri <%s> in Authorization header",
                          resp->uri);
            return HTTP_BAD_REQUEST;
        }
@@ -1791,7 +1790,7 @@ static int authenticate_digest_user(request_rec *r)
            if (apr_table_get(r->subprocess_env,
                              "AuthDigestEnableQueryStringHack")) {

                ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, "Digest: "
                ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r,
                              "applying AuthDigestEnableQueryStringHack "
                              "to uri <%s>", resp->raw_request_uri);

@@ -1802,7 +1801,7 @@ static int authenticate_digest_user(request_rec *r)
        if (r->method_number == M_CONNECT) {
            if (!r_uri.hostinfo || strcmp(resp->uri, r_uri.hostinfo)) {
                ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                              "Digest: uri mismatch - <%s> does not match "
                              "uri mismatch - <%s> does not match "
                              "request-uri <%s>", resp->uri, r_uri.hostinfo);
                return HTTP_BAD_REQUEST;
            }
@@ -1830,7 +1829,7 @@ static int authenticate_digest_user(request_rec *r)
                    || strcmp(d_uri.query, r_uri.query)))
            ) {
            ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                          "Digest: uri mismatch - <%s> does not match "
                          "uri mismatch - <%s> does not match "
                          "request-uri <%s>", resp->uri, resp->raw_request_uri);
            return HTTP_BAD_REQUEST;
        }
@@ -1838,7 +1837,7 @@ static int authenticate_digest_user(request_rec *r)

    if (resp->opaque && resp->opaque_num == 0) {
        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                      "Digest: received invalid opaque - got `%s'",
                      "received invalid opaque - got `%s'",
                      resp->opaque);
        note_digest_auth_failure(r, conf, resp, 0);
        return HTTP_UNAUTHORIZED;
@@ -1846,7 +1845,7 @@ static int authenticate_digest_user(request_rec *r)

    if (strcmp(resp->realm, conf->realm)) {
        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                      "Digest: realm mismatch - got `%s' but expected `%s'",
                      "realm mismatch - got `%s' but expected `%s'",
                      resp->realm, conf->realm);
        note_digest_auth_failure(r, conf, resp, 0);
        return HTTP_UNAUTHORIZED;
@@ -1856,7 +1855,7 @@ static int authenticate_digest_user(request_rec *r)
        && strcasecmp(resp->algorithm, "MD5")
        && strcasecmp(resp->algorithm, "MD5-sess")) {
        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                      "Digest: unknown algorithm `%s' received: %s",
                      "unknown algorithm `%s' received: %s",
                      resp->algorithm, r->uri);
        note_digest_auth_failure(r, conf, resp, 0);
        return HTTP_UNAUTHORIZED;
@@ -1866,7 +1865,7 @@ static int authenticate_digest_user(request_rec *r)

    if (return_code == AUTH_USER_NOT_FOUND) {
        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                      "Digest: user `%s' in realm `%s' not found: %s",
                      "user `%s' in realm `%s' not found: %s",
                      r->user, conf->realm, r->uri);
        note_digest_auth_failure(r, conf, resp, 0);
        return HTTP_UNAUTHORIZED;
@@ -1877,7 +1876,7 @@ static int authenticate_digest_user(request_rec *r)
    else if (return_code == AUTH_DENIED) {
        /* authentication denied in the provider before attempting a match */
        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                      "Digest: user `%s' in realm `%s' denied by provider: %s",
                      "user `%s' in realm `%s' denied by provider: %s",
                      r->user, conf->realm, r->uri);
        note_digest_auth_failure(r, conf, resp, 0);
        return HTTP_UNAUTHORIZED;
@@ -1894,7 +1893,7 @@ static int authenticate_digest_user(request_rec *r)
        /* old (rfc-2069) style digest */
        if (strcmp(resp->digest, old_digest(r, resp, conf->ha1))) {
            ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                          "Digest: user %s: password mismatch: %s", r->user,
                          "user %s: password mismatch: %s", r->user,
                          r->uri);
            note_digest_auth_failure(r, conf, resp, 0);
            return HTTP_UNAUTHORIZED;
@@ -1914,7 +1913,7 @@ static int authenticate_digest_user(request_rec *r)
            && !(conf->qop_list[0] == NULL
                 && !strcasecmp(resp->message_qop, "auth"))) {
            ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                          "Digest: invalid qop `%s' received: %s",
                          "invalid qop `%s' received: %s",
                          resp->message_qop, r->uri);
            note_digest_auth_failure(r, conf, resp, 0);
            return HTTP_UNAUTHORIZED;
@@ -1927,7 +1926,7 @@ static int authenticate_digest_user(request_rec *r)
        }
        if (strcmp(resp->digest, exp_digest)) {
            ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                          "Digest: user %s: password mismatch: %s", r->user,
                          "user %s: password mismatch: %s", r->user,
                          r->uri);
            note_digest_auth_failure(r, conf, resp, 0);
            return HTTP_UNAUTHORIZED;
@@ -2007,7 +2006,7 @@ static int add_auth_info(request_rec *r)
            ha1 = get_session_HA1(r, resp, conf, 0);
            if (!ha1) {
                ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                              "Digest: internal error: couldn't find session "
                              "internal error: couldn't find session "
                              "info for user %s", resp->username);
                return !OK;
            }
+36 −36

File changed.

Preview size limit exceeded, changes collapsed.

+36 −37
Changes for modules/cache/mod_cache_disk.c: 36 added lines, 37 removed lines.
Original line number Diff line number Diff line
@@ -174,7 +174,7 @@ static apr_status_t file_cache_el_final(disk_cache_conf *conf, disk_cache_file_t
        rv = safe_file_rename(conf, file->tempfile, file->file, file->pool);
        if (rv != APR_SUCCESS) {
            ap_log_rerror(APLOG_MARK, APLOG_WARNING, rv, r,
                    "cache_disk: rename tempfile to file failed:"
                    "rename tempfile to file failed:"
                    " %s -> %s", file->tempfile, file->file);
            apr_file_remove(file->tempfile, file->pool);
        }
@@ -351,7 +351,7 @@ static int create_entity(cache_handle_t *h, request_rec *r, const char *key, apr
    /* we don't support caching of range requests (yet) */
    if (r->status == HTTP_PARTIAL_CONTENT) {
        ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
                "cache_disk: URL %s partial content response not cached",
                "URL %s partial content response not cached",
                key);
        return DECLINED;
    }
@@ -359,14 +359,14 @@ static int create_entity(cache_handle_t *h, request_rec *r, const char *key, apr
    /* Note, len is -1 if unknown so don't trust it too hard */
    if (len > dconf->maxfs) {
        ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
                "cache_disk: URL %s failed the size check "
                "URL %s failed the size check "
                "(%" APR_OFF_T_FMT " > %" APR_OFF_T_FMT ")",
                key, len, dconf->maxfs);
        return DECLINED;
    }
    if (len >= 0 && len < dconf->minfs) {
        ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
                "cache_disk: URL %s failed the size check "
                "URL %s failed the size check "
                "(%" APR_OFF_T_FMT " < %" APR_OFF_T_FMT ")",
                key, len, dconf->minfs);
        return DECLINED;
@@ -425,7 +425,7 @@ static int open_entity(cache_handle_t *h, request_rec *r, const char *key)
        if (!error_logged) {
            error_logged = 1;
            ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                    "cache_disk: Cannot cache files to disk without a CacheRoot specified.");
                    "Cannot cache files to disk without a CacheRoot specified.");
        }
        return DECLINED;
    }
@@ -465,7 +465,7 @@ static int open_entity(cache_handle_t *h, request_rec *r, const char *key)
        rc = read_array(r, varray, dobj->vary.fd);
        if (rc != APR_SUCCESS) {
            ap_log_rerror(APLOG_MARK, APLOG_ERR, rc, r,
                    "cache_disk: Cannot parse vary header file: %s",
                    "Cannot parse vary header file: %s",
                    dobj->vary.file);
            apr_file_close(dobj->vary.fd);
            return DECLINED;
@@ -486,7 +486,7 @@ static int open_entity(cache_handle_t *h, request_rec *r, const char *key)
    }
    else if (format != DISK_FORMAT_VERSION) {
        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                "cache_disk: File '%s' has a version mismatch. File had version: %d.",
                "File '%s' has a version mismatch. File had version: %d.",
                dobj->vary.file, format);
        apr_file_close(dobj->vary.fd);
        return DECLINED;
@@ -522,7 +522,7 @@ static int open_entity(cache_handle_t *h, request_rec *r, const char *key)
    rc = file_cache_recall_mydata(dobj->hdrs.fd, info, dobj, r);
    if (rc != APR_SUCCESS) {
        ap_log_rerror(APLOG_MARK, APLOG_ERR, rc, r,
                "cache_disk: Cannot read header file %s", dobj->hdrs.file);
                "Cannot read header file %s", dobj->hdrs.file);
        apr_file_close(dobj->hdrs.fd);
        return DECLINED;
    }
@@ -532,7 +532,7 @@ static int open_entity(cache_handle_t *h, request_rec *r, const char *key)
    /* Is this a cached HEAD request? */
    if (dobj->disk_info.header_only && !r->header_only) {
        ap_log_rerror(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS, r,
                "cache_disk: HEAD request cached, non-HEAD requested, ignoring: %s",
                "HEAD request cached, non-HEAD requested, ignoring: %s",
                dobj->hdrs.file);
        return DECLINED;
    }
@@ -550,7 +550,7 @@ static int open_entity(cache_handle_t *h, request_rec *r, const char *key)
        rc = apr_file_open(&dobj->data.fd, dobj->data.file, flags, 0, r->pool);
        if (rc != APR_SUCCESS) {
            ap_log_rerror(APLOG_MARK, APLOG_ERR, rc, r,
                    "cache_disk: Cannot open data file %s", dobj->data.file);
                    "Cannot open data file %s", dobj->data.file);
            apr_file_close(dobj->hdrs.fd);
            return DECLINED;
        }
@@ -567,7 +567,7 @@ static int open_entity(cache_handle_t *h, request_rec *r, const char *key)

            /* Initialize the cache_handle callback functions */
            ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
                    "cache_disk: Recalled cached URL info header %s", dobj->name);
                    "Recalled cached URL info header %s", dobj->name);

            /* make the configuration stick */
            h->cache_obj = obj;
@@ -588,7 +588,7 @@ static int open_entity(cache_handle_t *h, request_rec *r, const char *key)

    /* Oh dear, no luck matching header to the body */
    ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
            "cache_disk: Cached URL info header '%s' didn't match body, ignoring this entry",
            "Cached URL info header '%s' didn't match body, ignoring this entry",
            dobj->name);

    return DECLINED;
@@ -615,7 +615,7 @@ static int remove_url(cache_handle_t *h, request_rec *r)
    /* Delete headers file */
    if (dobj->hdrs.file) {
        ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
                "cache_disk: Deleting %s from cache.", dobj->hdrs.file);
                "Deleting %s from cache.", dobj->hdrs.file);

        rc = apr_file_remove(dobj->hdrs.file, r->pool);
        if ((rc != APR_SUCCESS) && !APR_STATUS_IS_ENOENT(rc)) {
@@ -623,7 +623,7 @@ static int remove_url(cache_handle_t *h, request_rec *r)
             * For reason see log_error_core for the case s == NULL.
             */
            ap_log_rerror(APLOG_MARK, APLOG_DEBUG, rc, r,
                    "cache_disk: Failed to delete headers file %s from cache.",
                    "Failed to delete headers file %s from cache.",
                    dobj->hdrs.file);
            return DECLINED;
        }
@@ -632,7 +632,7 @@ static int remove_url(cache_handle_t *h, request_rec *r)
    /* Delete data file */
    if (dobj->data.file) {
        ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
                "cache_disk: Deleting %s from cache.", dobj->data.file);
                "Deleting %s from cache.", dobj->data.file);

        rc = apr_file_remove(dobj->data.file, r->pool);
        if ((rc != APR_SUCCESS) && !APR_STATUS_IS_ENOENT(rc)) {
@@ -640,7 +640,7 @@ static int remove_url(cache_handle_t *h, request_rec *r)
             * For reason see log_error_core for the case s == NULL.
             */
            ap_log_rerror(APLOG_MARK, APLOG_DEBUG, rc, r,
                    "cache_disk: Failed to delete data file %s from cache.",
                    "Failed to delete data file %s from cache.",
                    dobj->data.file);
            return DECLINED;
        }
@@ -672,8 +672,7 @@ static int remove_url(cache_handle_t *h, request_rec *r)
             */
            for (q = dir + dobj->root_len; *q ; ) {
                 ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
                        "cache_disk: Deleting directory %s from cache",
                        dir);
                        "Deleting directory %s from cache", dir);

                 rc = apr_dir_remove(dir, r->pool);
                 if (rc != APR_SUCCESS && !APR_STATUS_IS_ENOENT(rc)) {
@@ -850,7 +849,7 @@ static apr_status_t recall_headers(cache_handle_t *h, request_rec *r)
    /* This case should not happen... */
    if (!dobj->hdrs.fd) {
        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                "cache_disk: recalling headers; but no header fd for %s", dobj->name);
                "recalling headers; but no header fd for %s", dobj->name);
        return APR_NOTFOUND;
    }

@@ -864,7 +863,7 @@ static apr_status_t recall_headers(cache_handle_t *h, request_rec *r)
    apr_file_close(dobj->hdrs.fd);

    ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
            "cache_disk: Recalled headers for URL %s", dobj->name);
            "Recalled headers for URL %s", dobj->name);
    return APR_SUCCESS;
}

@@ -969,7 +968,7 @@ static apr_status_t write_headers(cache_handle_t *h, request_rec *r)

            if (rv != APR_SUCCESS) {
                ap_log_rerror(APLOG_MARK, APLOG_WARNING, rv, r,
                        "cache_disk: could not create vary file %s",
                        "could not create vary file %s",
                        dobj->vary.tempfile);
                return rv;
            }
@@ -978,7 +977,7 @@ static apr_status_t write_headers(cache_handle_t *h, request_rec *r)
            rv = apr_file_write(dobj->vary.tempfd, &format, &amt);
            if (rv != APR_SUCCESS) {
                ap_log_rerror(APLOG_MARK, APLOG_WARNING, rv, r,
                        "cache_disk: could not write to vary file %s",
                        "could not write to vary file %s",
                        dobj->vary.tempfile);
                apr_file_close(dobj->vary.tempfd);
                apr_pool_destroy(dobj->vary.pool);
@@ -990,7 +989,7 @@ static apr_status_t write_headers(cache_handle_t *h, request_rec *r)
                    &amt);
            if (rv != APR_SUCCESS) {
                ap_log_rerror(APLOG_MARK, APLOG_WARNING, rv, r,
                        "cache_disk: could not write to vary file %s",
                        "could not write to vary file %s",
                        dobj->vary.tempfile);
                apr_file_close(dobj->vary.tempfd);
                apr_pool_destroy(dobj->vary.pool);
@@ -1005,7 +1004,7 @@ static apr_status_t write_headers(cache_handle_t *h, request_rec *r)
            rv = apr_file_close(dobj->vary.tempfd);
            if (rv != APR_SUCCESS) {
                ap_log_rerror(APLOG_MARK, APLOG_WARNING, rv, r,
                        "cache_disk: could not close vary file %s",
                        "could not close vary file %s",
                        dobj->vary.tempfile);
                apr_pool_destroy(dobj->vary.pool);
                return rv;
@@ -1026,7 +1025,7 @@ static apr_status_t write_headers(cache_handle_t *h, request_rec *r)

    if (rv != APR_SUCCESS) {
       ap_log_rerror(APLOG_MARK, APLOG_WARNING, rv, r,
                "cache_disk: could not create header file %s",
                "could not create header file %s",
                dobj->hdrs.tempfile);
        return rv;
    }
@@ -1055,7 +1054,7 @@ static apr_status_t write_headers(cache_handle_t *h, request_rec *r)
    rv = apr_file_writev(dobj->hdrs.tempfd, (const struct iovec *) &iov, 2, &amt);
    if (rv != APR_SUCCESS) {
        ap_log_rerror(APLOG_MARK, APLOG_WARNING, rv, r,
                "cache_disk: could not write info to header file %s",
                "could not write info to header file %s",
                dobj->hdrs.tempfile);
        apr_file_close(dobj->hdrs.tempfd);
        apr_pool_destroy(dobj->hdrs.pool);
@@ -1066,7 +1065,7 @@ static apr_status_t write_headers(cache_handle_t *h, request_rec *r)
        rv = store_table(dobj->hdrs.tempfd, dobj->headers_out);
        if (rv != APR_SUCCESS) {
            ap_log_rerror(APLOG_MARK, APLOG_WARNING, rv, r,
                    "cache_disk: could not write out-headers to header file %s",
                    "could not write out-headers to header file %s",
                    dobj->hdrs.tempfile);
            apr_file_close(dobj->hdrs.tempfd);
            apr_pool_destroy(dobj->hdrs.pool);
@@ -1080,7 +1079,7 @@ static apr_status_t write_headers(cache_handle_t *h, request_rec *r)
        rv = store_table(dobj->hdrs.tempfd, dobj->headers_in);
        if (rv != APR_SUCCESS) {
            ap_log_rerror(APLOG_MARK, APLOG_WARNING, rv, r,
                    "cache_disk: could not write in-headers to header file %s",
                    "could not write in-headers to header file %s",
                    dobj->hdrs.tempfile);
            apr_file_close(dobj->hdrs.tempfd);
            apr_pool_destroy(dobj->hdrs.pool);
@@ -1091,7 +1090,7 @@ static apr_status_t write_headers(cache_handle_t *h, request_rec *r)
    rv = apr_file_close(dobj->hdrs.tempfd); /* flush and close */
    if (rv != APR_SUCCESS) {
        ap_log_rerror(APLOG_MARK, APLOG_WARNING, rv, r,
                "cache_disk: could not close header file %s",
                "could not close header file %s",
                dobj->hdrs.tempfile);
        apr_pool_destroy(dobj->hdrs.pool);
        return rv;
@@ -1162,7 +1161,7 @@ static apr_status_t store_body(cache_handle_t *h, request_rec *r,
        APR_BRIGADE_INSERT_TAIL(out, e);
        if (rv != APR_SUCCESS) {
            ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                    "cache_disk: Error when reading bucket for URL %s",
                    "Error when reading bucket for URL %s",
                    h->cache_obj->key);
            /* Remove the intermediate cache file and return non-APR_SUCCESS */
            apr_pool_destroy(dobj->data.pool);
@@ -1202,7 +1201,7 @@ static apr_status_t store_body(cache_handle_t *h, request_rec *r,
        rv = apr_file_write_full(dobj->data.tempfd, str, length, &written);
        if (rv != APR_SUCCESS) {
            ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                    "cache_disk: Error when writing cache file for URL %s",
                    "Error when writing cache file for URL %s",
                    h->cache_obj->key);
            /* Remove the intermediate cache file and return non-APR_SUCCESS */
            apr_pool_destroy(dobj->data.pool);
@@ -1211,7 +1210,7 @@ static apr_status_t store_body(cache_handle_t *h, request_rec *r,
        dobj->file_size += written;
        if (dobj->file_size > dconf->maxfs) {
            ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
                    "cache_disk: URL %s failed the size check "
                    "URL %s failed the size check "
                    "(%" APR_OFF_T_FMT ">%" APR_OFF_T_FMT ")",
                    h->cache_obj->key, dobj->file_size, dconf->maxfs);
            /* Remove the intermediate cache file and return non-APR_SUCCESS */
@@ -1253,7 +1252,7 @@ static apr_status_t store_body(cache_handle_t *h, request_rec *r,

        if (r->connection->aborted || r->no_cache) {
            ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r,
                    "cache_disk: Discarding body for URL %s "
                    "Discarding body for URL %s "
                    "because connection has been aborted.",
                    h->cache_obj->key);
            /* Remove the intermediate cache file and return non-APR_SUCCESS */
@@ -1262,7 +1261,7 @@ static apr_status_t store_body(cache_handle_t *h, request_rec *r,
        }
        if (dobj->file_size < dconf->minfs) {
            ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
                    "cache_disk: URL %s failed the size check "
                    "URL %s failed the size check "
                    "(%" APR_OFF_T_FMT "<%" APR_OFF_T_FMT ")",
                    h->cache_obj->key, dobj->file_size, dconf->minfs);
            /* Remove the intermediate cache file and return non-APR_SUCCESS */
@@ -1273,7 +1272,7 @@ static apr_status_t store_body(cache_handle_t *h, request_rec *r,
            apr_int64_t cl = apr_atoi64(cl_header);
            if ((errno == 0) && (dobj->file_size != cl)) {
                ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
                        "cache_disk: URL %s didn't receive complete response, not caching",
                        "URL %s didn't receive complete response, not caching",
                        h->cache_obj->key);
                /* Remove the intermediate cache file and return non-APR_SUCCESS */
                apr_pool_destroy(dobj->data.pool);
@@ -1312,12 +1311,12 @@ static apr_status_t commit_entity(cache_handle_t *h, request_rec *r)
    if (APR_SUCCESS != rv) {
        remove_url(h, r);
        ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
                "cache_disk: commit_entity: URL '%s' not cached due to earlier disk error.",
                "commit_entity: URL '%s' not cached due to earlier disk error.",
                dobj->name);
    }
    else {
        ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
                "cache_disk: commit_entity: Headers and body for URL %s cached.",
                "commit_entity: Headers and body for URL %s cached.",
                dobj->name);
    }

+8 −8

File changed.

Preview size limit exceeded, changes collapsed.

+5 −5
Changes for modules/cache/mod_socache_memcache.c: 5 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -103,7 +103,7 @@ static apr_status_t socache_mc_init(ap_socache_instance_t *ctx,
    rv = apr_memcache_create(p, nservers, 0, &ctx->mc);
    if (rv != APR_SUCCESS) {
        ap_log_error(APLOG_MARK, APLOG_CRIT, rv, s,
                     "socache: Failed to create Memcache Object of '%d' size.",
                     "Failed to create Memcache Object of '%d' size.",
                     nservers);
        return rv;
    }
@@ -120,13 +120,13 @@ static apr_status_t socache_mc_init(ap_socache_instance_t *ctx,
        rv = apr_parse_addr_port(&host_str, &scope_id, &port, split, p);
        if (rv != APR_SUCCESS) {
            ap_log_error(APLOG_MARK, APLOG_CRIT, rv, s,
                         "socache: Failed to Parse memcache Server: '%s'", split);
                         "Failed to Parse memcache Server: '%s'", split);
            return rv;
        }

        if (host_str == NULL) {
            ap_log_error(APLOG_MARK, APLOG_CRIT, rv, s,
                         "socache: Failed to Parse Server, "
                         "Failed to Parse Server, "
                         "no hostname specified: '%s'", split);
            return APR_EINVAL;
        }
@@ -144,7 +144,7 @@ static apr_status_t socache_mc_init(ap_socache_instance_t *ctx,
                                        &st);
        if (rv != APR_SUCCESS) {
            ap_log_error(APLOG_MARK, APLOG_CRIT, rv, s,
                         "socache: Failed to Create memcache Server: %s:%d",
                         "Failed to Create memcache Server: %s:%d",
                         host_str, port);
            return rv;
        }
@@ -152,7 +152,7 @@ static apr_status_t socache_mc_init(ap_socache_instance_t *ctx,
        rv = apr_memcache_add_server(ctx->mc, st);
        if (rv != APR_SUCCESS) {
            ap_log_error(APLOG_MARK, APLOG_CRIT, rv, s,
                         "socache: Failed to Add memcache Server: %s:%d",
                         "Failed to Add memcache Server: %s:%d",
                         host_str, port);
            return rv;
        }
Loading