httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jwool...@apache.org
Subject cvs commit: httpd-2.0/modules/cache mod_file_cache.c
Date Thu, 23 Jan 2003 00:55:47 GMT
jwoolley    2003/01/22 16:55:47

  Modified:    .        CHANGES
               modules/cache mod_file_cache.c
  Log:
  Fix a problem whereby multiple MMapFile directives would cause a segfault
  on startup.
  
  mod_file_cache keeps a hash table in the cmd->pool and puts an entry in
  that hash table for each of its files and mmaps, all of which are opened
  into cmd->pool.  But it registered a cleanup on cmd->pool that would walk
  the hash table and close each file and delete each mmap, even though by
  the time that happened those things would have been done already anyway
  by the files' and mmaps' own cleanups on cmd->pool.  So it was deleting
  mmaps that were already cleaned up and closing files that were already
  cleaned up in all cases.  This has never been valid... amazed it ever
  worked.  But apparently the true bogosity wasn't revealed until the new
  mmap cleanup code went into APR.
  
  PR: 16313
  
  Revision  Changes    Path
  1.1034    +3 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.1033
  retrieving revision 1.1034
  diff -u -d -u -r1.1033 -r1.1034
  --- CHANGES	21 Jan 2003 15:56:19 -0000	1.1033
  +++ CHANGES	23 Jan 2003 00:55:47 -0000	1.1034
  @@ -2,6 +2,9 @@
   
     [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]
   
  
  
  
  1.75      +0 -28     httpd-2.0/modules/cache/mod_file_cache.c
  
  Index: mod_file_cache.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/cache/mod_file_cache.c,v
  retrieving revision 1.74
  retrieving revision 1.75
  diff -u -d -u -r1.74 -r1.75
  --- mod_file_cache.c	23 Nov 2002 21:18:16 -0000	1.74
  +++ mod_file_cache.c	23 Jan 2003 00:55:47 -0000	1.75
  @@ -162,30 +162,6 @@
       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;
  @@ -274,10 +250,6 @@
       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)
  
  
  

Mime
View raw message