httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jerenkra...@apache.org
Subject cvs commit: httpd-2.0/modules/experimental mod_disk_cache.c
Date Tue, 28 Sep 2004 16:26:48 GMT
jerenkrantz    2004/09/28 09:26:48

  Modified:    .        CHANGES
               modules/experimental mod_disk_cache.c
  Log:
  mod_disk_cache: Do not store aborted content.
  
  PR: 21492
  Submitted by:	Rüdiger Plüm <r.pluem t-online.de>
  Reviewed by:	Justin Erenkrantz
  
  Revision  Changes    Path
  1.1602    +3 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.1601
  retrieving revision 1.1602
  diff -u -u -r1.1601 -r1.1602
  --- CHANGES	28 Sep 2004 16:17:37 -0000	1.1601
  +++ CHANGES	28 Sep 2004 16:26:46 -0000	1.1602
  @@ -2,6 +2,9 @@
   
     [Remove entries to the current 2.0 section below, when backported]
   
  +  *) mod_disk_cache: Do not store aborted content.  PR 21492.
  +     [Rüdiger Plüm <r.pluem t-online.de>]
  +
     *) mod_disk_cache: Correctly store cached content type.  PR 30278.
        [Rüdiger Plüm <r.pluem t-online.de>]
   
  
  
  
  1.64      +16 -0     httpd-2.0/modules/experimental/mod_disk_cache.c
  
  Index: mod_disk_cache.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/experimental/mod_disk_cache.c,v
  retrieving revision 1.63
  retrieving revision 1.64
  diff -u -u -r1.63 -r1.64
  --- mod_disk_cache.c	28 Sep 2004 16:17:38 -0000	1.63
  +++ mod_disk_cache.c	28 Sep 2004 16:26:48 -0000	1.64
  @@ -701,6 +701,22 @@
        */
       if (APR_BUCKET_IS_EOS(APR_BRIGADE_LAST(bb))) {
           if (h->cache_obj->info.len <= 0) {
  +          /* If the target value of the content length is unknown
  +           * (h->cache_obj->info.len <= 0), check if connection has been
  +           * aborted by client to avoid caching incomplete request bodies.
  +           *
  +           * This can happen with large responses from slow backends like
  +           * Tomcat via mod_jk.
  +           */
  +          if (r->connection->aborted) {
  +            ap_log_error(APLOG_MARK, APLOG_INFO, 0, r->server,
  +                         "disk_cache: Discarding body for URL %s "
  +                         "because connection has been aborted.",
  +                         h->cache_obj->key);
  +            /* Remove the intermediate cache file and return non-APR_SUCCESS */
  +            file_cache_errorcleanup(dobj, r);
  +            return APR_EGENERAL;
  +          }
             /* XXX Fixme: file_size isn't constrained by size_t. */
             h->cache_obj->info.len = dobj->file_size;
           }
  
  
  

Mime
View raw message