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;
}
/* 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;
/* 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 {
/* 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 {
* @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,