MCPcopy Create free account
hub / github.com/apache/httpd / file_cache_xlat

Function file_cache_xlat

modules/cache/mod_file_cache.c:239–268  ·  view source on GitHub ↗

If it's one of ours, fill in r->finfo now to avoid extra stat()... this is a * bit of a kludge, because we really want to run after core_translate runs. */

Source from the content-addressed store, hash-verified

237 * bit of a kludge, because we really want to run after core_translate runs.
238 */
239static int file_cache_xlat(request_rec *r)
240{
241 a_server_config *sconf;
242 a_file *match;
243 int res;
244
245 sconf = ap_get_module_config(r->server->module_config, &file_cache_module);
246
247 /* we only operate when at least one cachefile directive was used */
248 if (!apr_hash_count(sconf->fileht)) {
249 return DECLINED;
250 }
251
252 res = ap_core_translate(r);
253 if (res != OK || !r->filename) {
254 return res;
255 }
256
257 /* search the cache */
258 match = (a_file *) apr_hash_get(sconf->fileht, r->filename, APR_HASH_KEY_STRING);
259 if (match == NULL)
260 return DECLINED;
261
262 /* pass search results to handler */
263 ap_set_module_config(r->request_config, &file_cache_module, match);
264
265 /* shortcircuit the get_path_info() stat() calls and stuff */
266 r->finfo = match->finfo;
267 return OK;
268}
269
270static int mmap_handler(request_rec *r, a_file *file)
271{

Callers

nothing calls this directly

Calls 3

ap_get_module_configFunction · 0.85
ap_core_translateFunction · 0.85
ap_set_module_configFunction · 0.85

Tested by

no test coverage detected