httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 44579] New: mod_cache doesn't handle If-Range correctly
Date Tue, 11 Mar 2008 15:16:13 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=44579

           Summary: mod_cache doesn't handle If-Range correctly
           Product: Apache httpd-2
           Version: 2.2.8
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mod_cache
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: moog@sysdev.oucs.ox.ac.uk


Use mod_cache and mod_disk_cache.
Suppose an object is in the cache, but expired, and the backend has a newer
version of the object.
Request the object partially, using Range and If-Range, with an If-Range time
equal to the timestamp of the object in the cache.

Since the object has expired, mod_cache revalidates with the backend and
retrieves the newer version, deleting the old version from the cache.

According to the specification of If-Range in RFC2616, the server should
deliver the whole of the new version of the object, but instead it delivers
only the part of it specified in Range.

If the cached object is made current or deleted, If-Range requests are handled
correctly, until the backend version is updated again.

Looking towards the end of cache_save_filter in mod_cache.c:  

        /* Restore the original request headers and see if we need to
         * return anything else than the cached response (ie. the original
         * request was conditional).
         */
        r->headers_in = cache->stale_headers;
        status = ap_meets_conditions(r);
        if (status != OK) {
            r->status = status;

            bkt = apr_bucket_flush_create(bb->bucket_alloc);
            APR_BRIGADE_INSERT_TAIL(bb, bkt);
        }
        else {
            cache->provider->recall_body(cache->handle, r->pool, bb);
        }

ap_meets_conditions always returns OK for an If-Range request, so in the
situation described above, the If-Range request gets treated like an
unconditional request.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


Mime
View raw message