* Try obtain a cache wide lock on the given cache key.
*
* If we return APR_SUCCESS, we obtained the lock, and we are clear to
- * proceed to the backend. If we return APR_EEXISTS, the the lock is
+ * proceed to the backend. If we return APR_EEXISTS, then the lock is
* already locked, someone else has gone to refresh the backend data
* already, so we must return stale data with a warning in the mean
* time. If we return anything else, then something has gone pear
* This lock is created from the request pool, meaning that should
* something go wrong and the lock isn't deleted on return of the
* request headers from the backend for whatever reason, at worst the
- * lock will be cleaned up when the request is dies or finishes.
+ * lock will be cleaned up when the request dies or finishes.
*
* If something goes truly bananas and the lock isn't deleted when the
* request dies, the lock will be trashed when its max-age is reached,
/* give someone else the chance to cache the file */
ap_cache_remove_lock(conf, r, cache->handle ?
- (char *)cache->handle->cache_obj->key : NULL, in);
+ (char *)cache->handle->cache_obj->key : NULL, NULL);
}
+ else {
+
+ /* proactively remove the lock as soon as we see the eos bucket */
+ ap_cache_remove_lock(conf, r, cache->handle ?
+ (char *)cache->handle->cache_obj->key : NULL, in);
- /* proactively remove the lock as soon as we see the eos bucket */
- for (e = APR_BRIGADE_FIRST(in);
- e != APR_BRIGADE_SENTINEL(in);
- e = APR_BUCKET_NEXT(e))
- {
- if (APR_BUCKET_IS_EOS(e)) {
- ap_cache_remove_lock(conf, r, cache->handle ?
- (char *)cache->handle->cache_obj->key : NULL, in);
- break;
- }
}
return ap_pass_brigade(f->next, in);
/* remove the lock file unconditionally */
ap_cache_remove_lock(conf, r, cache->handle ?
- (char *)cache->handle->cache_obj->key : NULL, in);
+ (char *)cache->handle->cache_obj->key : NULL, 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);
ap_cache_remove_lock(conf, r, cache->handle ?
- (char *)cache->handle->cache_obj->key : NULL, in);
+ (char *)cache->handle->cache_obj->key : NULL, NULL);
return ap_pass_brigade(f->next, in);
}
/* let someone else attempt to cache */
ap_cache_remove_lock(conf, r, cache->handle ?
- (char *)cache->handle->cache_obj->key : NULL, in);
+ (char *)cache->handle->cache_obj->key : NULL, NULL);
return ap_pass_brigade(f->next, bb);
}
ap_remove_output_filter(f);
ap_cache_remove_lock(conf, r, cache->handle ?
- (char *)cache->handle->cache_obj->key : NULL, in);
+ (char *)cache->handle->cache_obj->key : NULL, NULL);
return ap_pass_brigade(f->next, in);
}
"cache: store_body failed");
ap_remove_output_filter(f);
ap_cache_remove_lock(conf, r, cache->handle ?
- (char *)cache->handle->cache_obj->key : NULL, in);
+ (char *)cache->handle->cache_obj->key : NULL, NULL);
return ap_pass_brigade(f->next, in);
}
/* proactively remove the lock as soon as we see the eos bucket */
- for (e = APR_BRIGADE_FIRST(in);
- e != APR_BRIGADE_SENTINEL(in);
- e = APR_BUCKET_NEXT(e))
- {
- if (APR_BUCKET_IS_EOS(e)) {
- ap_cache_remove_lock(conf, r, cache->handle ?
- (char *)cache->handle->cache_obj->key : NULL, in);
- break;
- }
- }
+ ap_cache_remove_lock(conf, r, cache->handle ?
+ (char *)cache->handle->cache_obj->key : NULL, in);
return ap_pass_brigade(f->next, in);
}