httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rede...@apache.org
Subject cvs commit: httpd-2.0/modules/experimental mod_mem_cache.c
Date Tue, 03 Feb 2004 15:30:58 GMT
rederpj     2004/02/03 07:30:58

  Modified:    .        Tag: APACHE_2_0_BRANCH CHANGES STATUS
               modules/experimental Tag: APACHE_2_0_BRANCH mod_mem_cache.c
  Log:
  *) Fix segfault in mod_mem_cache cache_insert() due to cache size
     becoming negative.  PR: 21285, 21287
  
    Submitted by: Bill Stoddard, Massimo Torquati, Jean-Jacques Clar
    Reviewed by: stoddard, rederpj, trawick
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.988.2.231 +4 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.988.2.230
  retrieving revision 1.988.2.231
  diff -u -r1.988.2.230 -r1.988.2.231
  --- CHANGES	30 Jan 2004 16:20:50 -0000	1.988.2.230
  +++ CHANGES	3 Feb 2004 15:30:57 -0000	1.988.2.231
  @@ -1,5 +1,9 @@
   Changes with Apache 2.0.49
   
  +  *) Fix segfault in mod_mem_cache cache_insert() due to cache size
  +     becoming negative.  PR: 21285, 21287
  +     [Bill Stoddard, Massimo Torquati, Jean-Jacques Clar]
  +
     *) core.c: If large file support is enabled, allow any file that is
        greater than AP_MAX_SENDFILE to be split into multiple buckets.
        This allows Apache to send files that are greater than 2gig.
  
  
  
  1.751.2.669 +1 -6      httpd-2.0/STATUS
  
  Index: STATUS
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/STATUS,v
  retrieving revision 1.751.2.668
  retrieving revision 1.751.2.669
  diff -u -r1.751.2.668 -r1.751.2.669
  --- STATUS	2 Feb 2004 13:18:07 -0000	1.751.2.668
  +++ STATUS	3 Feb 2004 15:30:57 -0000	1.751.2.669
  @@ -90,11 +90,6 @@
         jerenkrantz: Why is rm not application/vnd.rn-realmedia as in PR 26079?
         +1: nd, trawick
   
  -    * Fix segfault in mod_mem_cache cache_insert() due to cache size
  -      becoming negative.  PR: 21285, 21287
  -      http://cvs.apache.org/viewcvs.cgi/httpd-2.0/modules/experimental/mod_mem_cache.c?r1=1.99&r2=1.100
  -      +1: stoddard, rederpj, trawick
  -
       * Replace some of the mutex locking in the worker MPM with
         atomic operations for higher concurrency.
         server/mpm/worker/fdqueue.c 1.24, 1.25
  
  
  
  No                   revision
  No                   revision
  1.88.2.5  +22 -1     httpd-2.0/modules/experimental/mod_mem_cache.c
  
  Index: mod_mem_cache.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/experimental/mod_mem_cache.c,v
  retrieving revision 1.88.2.4
  retrieving revision 1.88.2.5
  diff -u -r1.88.2.4 -r1.88.2.5
  --- mod_mem_cache.c	1 Jan 2004 13:30:39 -0000	1.88.2.4
  +++ mod_mem_cache.c	3 Feb 2004 15:30:58 -0000	1.88.2.5
  @@ -1035,7 +1035,28 @@
                   if (sconf->lock) {
                       apr_thread_mutex_lock(sconf->lock);
                   }
  -                cache_remove(sconf->cache_cache, obj);
  +                if (obj->cleanup) {
  +                    /* If obj->cleanup is set, the object has been prematurly 
  +                     * ejected from the cache by the garbage collector. Add the
  +                     * object back to the cache. If an object with the same key is 
  +                     * found in the cache, eject it in favor of the completed obj.
  +                     */
  +                    cache_object_t *tmp_obj =
  +                      (cache_object_t *) cache_find(sconf->cache_cache, obj->key);
  +                    if (tmp_obj) {
  +                        cache_remove(sconf->cache_cache, tmp_obj);
  +                        sconf->object_cnt--;
  +                        sconf->cache_size -= mobj->m_len;
  +                        tmp_obj->cleanup = 1;
  +                        if (!tmp_obj->refcount) {
  +                            cleanup_cache_object(tmp_obj);
  +                        }
  +                    }
  +                    obj->cleanup = 0;
  +                }
  +                else {
  +                    cache_remove(sconf->cache_cache, obj);
  +                }
                   mobj->m_len = obj->count;
                   cache_insert(sconf->cache_cache, obj);                
                   sconf->cache_size -= (mobj->m_len - obj->count);
  
  
  

Mime
View raw message