httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stodd...@apache.org
Subject cvs commit: httpd-2.0/modules/experimental mod_cache.c
Date Fri, 24 Aug 2001 16:33:10 GMT
stoddard    01/08/24 09:33:10

  Modified:    modules/experimental mod_cache.c
  Log:
  Uninstall the filter if the caching layer declines the cache request.
  
  Revision  Changes    Path
  1.10      +8 -2      httpd-2.0/modules/experimental/mod_cache.c
  
  Index: mod_cache.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/experimental/mod_cache.c,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- mod_cache.c	2001/08/23 19:46:55	1.9
  +++ mod_cache.c	2001/08/24 16:33:10	1.10
  @@ -347,6 +347,7 @@
   
   int ap_cache_in_filter(ap_filter_t *f, apr_bucket_brigade *in)
   {
  +    int rv;
       request_rec *r = f->r;
       char *url = r->unparsed_uri;
       const char *cc_out = ap_table_get(r->headers_out, "Cache-Control");
  @@ -520,7 +521,7 @@
        */
       /* no cache handle, create a new entity */
       if (!cache->handle) {
  -        cache_create_entity(r, cache->types, url, size);
  +        rv = cache_create_entity(r, cache->types, url, size);
       }
       /* pre-existing cache handle and 304, make entity fresh */
       else if (r->status == HTTP_NOT_MODIFIED) {
  @@ -531,9 +532,14 @@
       /* pre-existing cache handle and new entity, replace entity with this one */
       else {
           cache_remove_entity(r, cache->types, cache->handle);
  -        cache_create_entity(r, cache->types, url, size);
  +        rv = cache_create_entity(r, cache->types, url, size);
       }
       
  +    if (rv != OK) {
  +        /* Caching layer declined the opportunity to cache the response */
  +        ap_remove_output_filter(f);
  +        return ap_pass_brigade(f->next, in);
  +    }
       
       /*
        * We now want to update the cache file header information with
  
  
  

Mime
View raw message