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 45049] New: mod_mem_cache caches partial content when client connection is terminated.
Date Tue, 20 May 2008 20:11:38 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=45049

           Summary: mod_mem_cache caches partial content when client
                    connection is terminated.
           Product: Apache httpd-2
           Version: 2.2.8
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mod_cache
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: nick@simplylogic.net


Hi, 

I’m running apache 2.2.8 with mod_cache + mod_mem_cache. I’ve configured
all content to be cached. Content is served from a backend server. I’ve found
if a “non cached page” is requested and the socket to apache is terminated
before all content is read from backend server and dispatched to client,
mod_mem_cache caches partial content! When I make a subsequent request for the
same page, the partial content is returned from cache. 
In apache 2.0 the configuration value CacheForceCompletion details the cache
will only be populated with complete content. This config value has now been
removed! Is there a flag to control such behaviour? I require all content
stored in cache to be 100% and never partial. 

At present to no avail I’ve found nothing detailing the above issues! So, I
had a look at mod_mem_cache and plugged in the below code as a temporary
solution which works a treat. 

    /*
     * FD cacheing is not enabled or the content was not
     * suitable for fd caching.
     */
    if (mobj->m == NULL) {
        mobj->m = malloc(mobj->m_len);
        if (mobj->m == NULL) {
            return APR_ENOMEM;
        }
        obj->count = 0;
    }
    cur = (char*) mobj->m + obj->count;

// START CHANGE
        if (r->connection->aborted==1) {
                // Connection aborted, do not cache this page! 
ap_log_error(APLOG_MARK, APLOG_INFO, 0, r->server, "socket aborted!“);
obj->count = 0;
return APR_ENOMEM;
        }
// END CHANGE

    /* Iterate accross the brigade and populate the cache storage */
    for (e = APR_BRIGADE_FIRST(b);
         e != APR_BRIGADE_SENTINEL(b);
         e = APR_BUCKET_NEXT(e))
    {

I need to understand if I’ve missed something or the behaviour I’m
experiencing is a feature! 

Thanks again...I've already posted a number of questions on other sites but no
one has been able to answer. 

Cheers, Nick


-- 
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