httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jerenkra...@apache.org
Subject svn commit: r152680 - in httpd/httpd/trunk/modules/cache: cache_storage.c mod_cache.c mod_cache.h
Date Tue, 08 Feb 2005 17:56:40 GMT
Author: jerenkrantz
Date: Tue Feb  8 09:56:38 2005
New Revision: 152680

URL: http://svn.apache.org/viewcvs?view=rev&rev=152680
Log:
Return the proper status and headers when serving a revalidated response.

* modules/cache/mod_cache.c
  (cache_save_filter): Load in the cached status and headers; send a flush
  rather than an EOS when the client request is conditional.
* modules/cache/mod_cache.h: Export ap_cache_accept_headers.
* modules/cache/cache_storage.c: Rename accept_headers to
  ap_cache_accept_headers.

Modified:
    httpd/httpd/trunk/modules/cache/cache_storage.c
    httpd/httpd/trunk/modules/cache/mod_cache.c
    httpd/httpd/trunk/modules/cache/mod_cache.h

Modified: httpd/httpd/trunk/modules/cache/cache_storage.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/cache/cache_storage.c?view=diff&r1=152679&r2=152680
==============================================================================
--- httpd/httpd/trunk/modules/cache/cache_storage.c (original)
+++ httpd/httpd/trunk/modules/cache/cache_storage.c Tue Feb  8 09:56:38 2005
@@ -105,7 +105,7 @@
     return 1;
 }
 
-static void accept_headers(cache_handle_t *h, request_rec *r)
+CACHE_DECLARE(void) ap_cache_accept_headers(cache_handle_t *h, request_rec *r)
 {
     apr_table_t *cookie_table;
     const char *v;
@@ -272,7 +272,7 @@
             }
 
             /* Okay, this response looks okay.  Merge in our stuff and go. */
-            accept_headers(h, r);
+            ap_cache_accept_headers(h, r);
 
             cache->handle = h;
             return OK;

Modified: httpd/httpd/trunk/modules/cache/mod_cache.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/cache/mod_cache.c?view=diff&r1=152679&r2=152680
==============================================================================
--- httpd/httpd/trunk/modules/cache/mod_cache.c (original)
+++ httpd/httpd/trunk/modules/cache/mod_cache.c Tue Feb  8 09:56:38 2005
@@ -532,6 +532,12 @@
             /* Oh, hey.  It isn't that stale!  Yay! */
             cache->handle = cache->stale_handle;
             info = &cache->handle->cache_obj->info;
+            /* Load in the saved status. */
+            r->status = info->status;
+            /* The cached response will override our err_headers_out. */
+            apr_table_clear(r->err_headers_out);
+            /* Merge in our headers. */
+            ap_cache_accept_headers(cache->handle, r);
             rv = OK;
         }
         else {
@@ -665,7 +671,7 @@
             /* FIXME: Should we now go and make sure it's really not
              * modified since what the user thought?
              */
-            bkt = apr_bucket_eos_create(bb->bucket_alloc);
+            bkt = apr_bucket_flush_create(bb->bucket_alloc);
             APR_BRIGADE_INSERT_TAIL(bb, bkt);
         }
         else {

Modified: httpd/httpd/trunk/modules/cache/mod_cache.h
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/cache/mod_cache.h?view=diff&r1=152679&r2=152680
==============================================================================
--- httpd/httpd/trunk/modules/cache/mod_cache.h (original)
+++ httpd/httpd/trunk/modules/cache/mod_cache.h Tue Feb  8 09:56:38 2005
@@ -240,6 +240,9 @@
  * @return 0 ==> cache object is stale, 1 ==> cache object is fresh
  */
 CACHE_DECLARE(int) ap_cache_check_freshness(cache_handle_t *h, request_rec *r);
+
+CACHE_DECLARE(void) ap_cache_accept_headers(cache_handle_t *h, request_rec *r);
+
 CACHE_DECLARE(apr_time_t) ap_cache_hex2usec(const char *x);
 CACHE_DECLARE(void) ap_cache_usec2hex(apr_time_t j, char *y);
 CACHE_DECLARE(char *) generate_name(apr_pool_t *p, int dirlevels, 



Mime
View raw message