Commit 8bca01cd authored by Sander Striker's avatar Sander Striker
Browse files

Tracked down by Justin Erenkrantz.

* modules/cache/mod_disk_cache.c

  (store_headers): Stop second guessing mod_cache and just store the
   headers in a new file (overwriting the old).

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@156306 13f79535-47bb-0310-9956-ffa450edef68
parent 11b71286
Loading
Loading
Loading
Loading
+61 −67
Original line number Diff line number Diff line
@@ -529,7 +529,6 @@ static apr_status_t store_headers(cache_handle_t *h, request_rec *r, cache_info
    apr_size_t amt;
    disk_cache_object_t *dobj = (disk_cache_object_t*) h->cache_obj->vobj;

    if (!dobj->hfd)  {
    disk_cache_info_t disk_info;
    struct iovec iov[2];

@@ -579,8 +578,8 @@ static apr_status_t store_headers(cache_handle_t *h, request_rec *r, cache_info
        headers_out = ap_cache_cacheable_hdrs_out(r->pool, r->headers_out,
                                                  r->server);

            if (!apr_table_get(headers_out, "Content-Type") &&
                r->content_type) {
        if (!apr_table_get(headers_out, "Content-Type")
            && r->content_type) {
            apr_table_setn(headers_out, "Content-Type",
                           ap_make_content_type(r, r->content_type));
        }
@@ -591,12 +590,10 @@ static apr_status_t store_headers(cache_handle_t *h, request_rec *r, cache_info
        if (rv != APR_SUCCESS) {
            return rv;
        }

    }

    /* Parse the vary header and dump those fields from the headers_in. */
        /* Make call to the same thing cache_select_url calls to crack Vary. */
        /* @@@ Some day, not today. */
    /* FIXME: Make call to the same thing cache_select_url calls to crack Vary. */
    if (r->headers_in) {
        apr_table_t *headers_in;

@@ -607,11 +604,8 @@ static apr_status_t store_headers(cache_handle_t *h, request_rec *r, cache_info
            return rv;
        }
    }
    
    apr_file_close(dobj->hfd); /* flush and close */
    }
    else {
        /* XXX log message */
    }

    ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
                 "disk_cache: Stored headers for URL %s",  dobj->name);