* no point is it possible for this lock to permanently deny access to
* the backend.
*/
-apr_status_t cache_try_lock(cache_server_conf *conf,
- cache_request_rec *cache, request_rec *r, char *key)
+apr_status_t cache_try_lock(cache_server_conf *conf, cache_request_rec *cache,
+ request_rec *r)
{
apr_status_t status;
const char *lockname;
}
/* create the key if it doesn't exist */
- if (!key) {
+ if (!cache->key) {
cache_generate_key(r, r->pool, &cache->key);
}
/* create a hashed filename from the key, and save it for later */
- lockname = ap_cache_generate_name(r->pool, 0, 0, key);
+ lockname = ap_cache_generate_name(r->pool, 0, 0, cache->key);
/* lock files represent discrete just-went-stale URLs "in flight", so
* we support a simple two level directory structure, more is overkill.
* removed if the bucket brigade contains an EOS bucket.
*/
apr_status_t cache_remove_lock(cache_server_conf *conf,
- cache_request_rec *cache, request_rec *r, char *key,
- apr_bucket_brigade *bb)
+ cache_request_rec *cache, request_rec *r, apr_bucket_brigade *bb)
{
void *dummy;
const char *lockname;
char dir[5];
/* create the key if it doesn't exist */
- if (!key) {
+ if (!cache->key) {
cache_generate_key(r, r->pool, &cache->key);
}
/* create a hashed filename from the key, and save it for later */
- lockname = ap_cache_generate_name(r->pool, 0, 0, key);
+ lockname = ap_cache_generate_name(r->pool, 0, 0, cache->key);
/* lock files represent discrete just-went-stale URLs "in flight", so
* we support a simple two level directory structure, more is overkill.
* A lock that exceeds a maximum age will be deleted, and another
* request gets to make a new lock and try again.
*/
- status = cache_try_lock(conf, cache, r, (char *)h->cache_obj->key);
+ status = cache_try_lock(conf, cache, r);
if (APR_SUCCESS == status) {
/* we obtained a lock, follow the stale path */
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
* no point is it possible for this lock to permanently deny access to
* the backend.
*/
-apr_status_t cache_try_lock(cache_server_conf *conf,
- cache_request_rec *cache, request_rec *r, char *key);
+apr_status_t cache_try_lock(cache_server_conf *conf, cache_request_rec *cache,
+ request_rec *r);
/**
* Remove the cache lock, if present.
* removed if the bucket brigade contains an EOS bucket.
*/
apr_status_t cache_remove_lock(cache_server_conf *conf,
- cache_request_rec *cache, request_rec *r, char *key,
- apr_bucket_brigade *bb);
+ cache_request_rec *cache, request_rec *r, apr_bucket_brigade *bb);
cache_provider_list *cache_get_providers(request_rec *r,
cache_server_conf *conf, apr_uri_t uri);
* backend without any attempt to cache. this stops
* duplicated simultaneous attempts to cache an entity.
*/
- rv = cache_try_lock(conf, cache, r, NULL);
+ rv = cache_try_lock(conf, cache, r);
if (APR_SUCCESS == rv) {
/*
* backend without any attempt to cache. this stops
* duplicated simultaneous attempts to cache an entity.
*/
- rv = cache_try_lock(conf, cache, r, NULL);
+ rv = cache_try_lock(conf, cache, r);
if (APR_SUCCESS == rv) {
/*
ap_remove_output_filter(f);
/* give someone else the chance to cache the file */
- cache_remove_lock(conf, cache, f->r, cache->handle ?
- (char *)cache->handle->cache_obj->key : NULL, NULL);
+ cache_remove_lock(conf, cache, f->r, NULL);
/* give up trying to cache, just step out the way */
APR_BRIGADE_PREPEND(in, cache->out);
}
/* conditionally remove the lock as soon as we see the eos bucket */
- cache_remove_lock(conf, cache, f->r, cache->handle ?
- (char *)cache->handle->cache_obj->key : NULL, cache->out);
+ cache_remove_lock(conf, cache, f->r, cache->out);
if (APR_BRIGADE_EMPTY(cache->out)) {
if (APR_BRIGADE_EMPTY(in)) {
ap_remove_output_filter(f);
/* give someone else the chance to cache the file */
- cache_remove_lock(conf, cache, f->r, cache->handle ?
- (char *)cache->handle->cache_obj->key : NULL, NULL);
+ cache_remove_lock(conf, cache, f->r, NULL);
return ap_pass_brigade(f->next, in);
}
reason));
/* let someone else attempt to cache */
- cache_remove_lock(conf, cache, r, cache->handle ?
- (char *)cache->handle->cache_obj->key : NULL, NULL);
+ cache_remove_lock(conf, cache, r, NULL);
return ap_pass_brigade(f->next, bb);
}
ap_remove_output_filter(f);
/* remove the lock file unconditionally */
- cache_remove_lock(conf, cache, r, cache->handle ?
- (char *)cache->handle->cache_obj->key : NULL, NULL);
+ cache_remove_lock(conf, cache, r, NULL);
/* ship the data up the stack */
return ap_pass_brigade(f->next, in);
/* Caching layer declined the opportunity to cache the response */
ap_remove_output_filter(f);
- cache_remove_lock(conf, cache, r, cache->handle ?
- (char *)cache->handle->cache_obj->key : NULL, NULL);
+ cache_remove_lock(conf, cache, r, NULL);
return ap_pass_brigade(f->next, in);
}
}
/* let someone else attempt to cache */
- cache_remove_lock(conf, cache, r, cache->handle ?
- (char *)cache->handle->cache_obj->key : NULL, NULL);
+ cache_remove_lock(conf, cache, r, NULL);
return ap_pass_brigade(f->next, bb);
}
"cache miss: store_headers failed");
ap_remove_output_filter(f);
- cache_remove_lock(conf, cache, r, cache->handle ?
- (char *)cache->handle->cache_obj->key : NULL, NULL);
+ cache_remove_lock(conf, cache, r, NULL);
return ap_pass_brigade(f->next, in);
}