On 5/17/07, Niklas Edmundsson <[EMAIL PROTECTED]> wrote:
Has there been any progress on PR41230? I submitted a patch that at
least seems to improve the situation that now seems to have seen some
testing by others as well.

As I have stated before, it would be really nice if a fix for this
could be committed, be it my patch or some other solution.

(It'd be helpful if you posted the patch here instead of forcing us to
go to Bugzilla...)

Anyway, the core of the patch is okay - but what's the deal with the
rv = !OK line?  I don't see how or why that's necessary as rv is
already initialized to that.

I'd tweak it to be as follows for readability though.  If this still
fixes your problem, I can commit and propose for backport.  Thanks!
-- justin

Index: modules/cache/mod_cache.c
===================================================================
--- modules/cache/mod_cache.c   (revision 539156)
+++ modules/cache/mod_cache.c   (working copy)
@@ -476,8 +476,10 @@
        reason = "No Last-Modified, Etag, or Expires headers";
    }
    else if (r->header_only) {
-        /* HEAD requests */
-        reason = "HTTP HEAD request";
+        /* Forbid HEAD requests unless we have it cached already */
+        if (!cache->stale_handle) {
+            reason = "HTTP HEAD request";
+        }
    }
    else if (!conf->store_nostore &&
             ap_cache_liststr(NULL, cc_out, "no-store", NULL)) {
@@ -611,8 +613,8 @@
        }
    }

-    /* no cache handle, create a new entity */
-    if (!cache->handle) {
+    /* no cache handle, create a new entity only for non-HEAD requests */
+    if (!cache->handle && !r->header_only) {
        rv = cache_create_entity(r, size);
        info = apr_pcalloc(r->pool, sizeof(cache_info));
        /* We only set info->status upon the initial creation. */

Reply via email to