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. */
| 237 | * bit of a kludge, because we really want to run after core_translate runs. |
| 238 | */ |
| 239 | static 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 | |
| 270 | static int mmap_handler(request_rec *r, a_file *file) |
| 271 | { |
nothing calls this directly
no test coverage detected