[Remove entries to the current 2.0 section below, when backported]
+ *) mod_file_cache: fixed a segfault when multiple MMapFile directives
+ were used. PR 16313. [Cliff Woolley]
+
*) Move RFC 1413 ident requests from core to new module mod_ident.
[André Malo]
return sconf;
}
-static apr_status_t cleanup_file_cache(void *sconfv)
-{
- a_server_config *sconf = sconfv;
- apr_pool_t *p = apr_hash_pool_get(sconf->fileht);
- a_file *file;
- apr_hash_index_t *hi;
-
- /* Iterate over the file hash table and clean up each entry */
- for (hi = apr_hash_first(p, sconf->fileht); hi; hi=apr_hash_next(hi)) {
- apr_hash_this(hi, NULL, NULL, (void **)&file);
-#if APR_HAS_MMAP
- if (file->is_mmapped) {
- apr_mmap_delete(file->mm);
- }
-#endif
-#if APR_HAS_SENDFILE
- if (!file->is_mmapped) {
- apr_file_close(file->file);
- }
-#endif
- }
- return APR_SUCCESS;
-}
-
static void cache_the_file(cmd_parms *cmd, const char *filename, int mmap)
{
a_server_config *sconf;
sconf = ap_get_module_config(cmd->server->module_config, &file_cache_module);
apr_hash_set(sconf->fileht, new_file->filename, strlen(new_file->filename), new_file);
- if (apr_hash_count(sconf->fileht) == 1) {
- /* first one, register the cleanup */
- apr_pool_cleanup_register(cmd->pool, sconf, cleanup_file_cache, apr_pool_cleanup_null);
- }
}
static const char *cachefilehandle(cmd_parms *cmd, void *dummy, const char *filename)