httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stodd...@apache.org
Subject cvs commit: httpd-2.0/modules/cache mod_file_cache.c
Date Thu, 23 Jan 2003 21:01:09 GMT
stoddard    2003/01/23 13:01:09

  Modified:    modules/cache mod_file_cache.c
  Log:
  dup the apr_mmap_t out of the request pool for sending down on the brigade
  
  Revision  Changes    Path
  1.76      +4 -11     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.75
  retrieving revision 1.76
  diff -u -r1.75 -r1.76
  --- mod_file_cache.c	23 Jan 2003 00:55:47 -0000	1.75
  +++ mod_file_cache.c	23 Jan 2003 21:01:08 -0000	1.76
  @@ -210,13 +210,11 @@
   
   #if APR_HAS_MMAP
       if (mmap) {
  -        apr_mmap_t *mm;
  -
           /* MMAPFile directive. MMAP'ing the file
            * XXX: APR_HAS_LARGE_FILES issue; need to reject this request if
            * size is greater than MAX(apr_size_t) (perhaps greater than 1M?).
            */
  -        if ((rc = apr_mmap_create(&mm, fd, 0, 
  +        if ((rc = apr_mmap_create(&new_file->mm, fd, 0, 
                                     (apr_size_t)new_file->finfo.size,
                                     APR_MMAP_READ, cmd->pool)) != APR_SUCCESS) { 
               apr_file_close(fd);
  @@ -225,13 +223,6 @@
               return;
           }
           apr_file_close(fd);
  -        /* We want to cache a duplicate apr_mmap_t to pass to each
  -         * request so that nothing in the request will ever think that
  -         * it's allowed to delete the mmap, since the "refcount" will
  -         * never reach zero. */
  -        /* XXX: the transfer_ownership flag on this call
  -         * will go away soon.. it's ignored right now. */
  -        apr_mmap_dup(&new_file->mm, mm, cmd->pool, 0);
           new_file->is_mmapped = TRUE;
       }
   #endif
  @@ -321,9 +312,11 @@
   #if APR_HAS_MMAP
       conn_rec *c = r->connection;
       apr_bucket *b;
  +    apr_mmap_t *mm;
       apr_bucket_brigade *bb = apr_brigade_create(r->pool, c->bucket_alloc);
   
  -    b = apr_bucket_mmap_create(file->mm, 0, (apr_size_t)file->finfo.size,
  +    apr_mmap_dup(&mm, file->mm, r->pool, 0);
  +    b = apr_bucket_mmap_create(mm, 0, (apr_size_t)file->finfo.size,
                                  c->bucket_alloc);
       APR_BRIGADE_INSERT_TAIL(bb, b);
       b = apr_bucket_eos_create(c->bucket_alloc);
  
  
  

Mime
View raw message