httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From i...@apache.org
Subject cvs commit: httpd-2.0/modules/cache mod_file_cache.c
Date Wed, 21 Nov 2001 17:01:42 GMT
ianh        01/11/21 09:01:42

  Modified:    modules/cache mod_file_cache.c
  Log:
  let mod_file_cache use the new apr_mmap_dup function
  Submitted by:	Brian Pane
  
  Revision  Changes    Path
  1.63      +13 -1     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.62
  retrieving revision 1.63
  diff -u -r1.62 -r1.63
  --- mod_file_cache.c	2001/08/11 04:04:12	1.62
  +++ mod_file_cache.c	2001/11/21 17:01:42	1.63
  @@ -333,8 +333,20 @@
   #if APR_HAS_MMAP
       apr_bucket *b;
       apr_bucket_brigade *bb = apr_brigade_create(r->pool);
  +    apr_mmap_t *mm;
   
  -    b = apr_bucket_mmap_create(file->mm, 0, (apr_size_t)file->finfo.size);
  +    /* Create a copy of the apr_mmap_t that's marked as
  +     * a "non-owner."  The reason for this is that the
  +     * mmap bucket setaside function might later try to
  +     * transfer ownership of the mmap from a request
  +     * pool to a parent pool.  For this particular mmap,
  +     * though, we want the cache to retain ownership so
  +     * that it never gets munmapped.  Thus we give the
  +     * bucket code a non-owner copy to work with.
  +     */
  +    apr_mmap_dup(&mm, file->mm, r->pool, 0);
  +
  +    b = apr_bucket_mmap_create(mm, 0, (apr_size_t)file->finfo.size);
       APR_BRIGADE_INSERT_TAIL(bb, b);
       b = apr_bucket_eos_create();
       APR_BRIGADE_INSERT_TAIL(bb, b);
  
  
  

Mime
View raw message