Commit 9a1b534c authored by Graham Leggett's avatar Graham Leggett
Browse files

Do not store aborted content.

PR:	21492
Obtained from:
Submitted by:	R|diger Pl|m <r.pluem t-online.de>
Reviewed by:	stoddard, jerenkrantz, minfrin, jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/APACHE_2_0_BRANCH@105430 13f79535-47bb-0310-9956-ffa450edef68
parent 1e02931a
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
Changes with Apache 2.0.53
  *) mod_disk_cache: Do not store aborted content.  PR 21492.
     [Rüiger Plü <r.pluem t-online.de>]
  *) mod_disk_cache: Correctly store cached content type.  PR 30278.
     [Rüiger Plü <r.pluem t-online.de>]
+1 −5
Original line number Diff line number Diff line
APACHE 2.0 STATUS:                                              -*-text-*-
Last modified at [$Date: 2004/10/13 16:32:05 $]
Last modified at [$Date: 2004/10/13 16:40:54 $]

Release:

@@ -115,10 +115,6 @@ PATCHES TO BACKPORT FROM 2.1
       jorton replies: it does indeed, hang on...
       +1: jorton

    *) Do not store aborted content. PR 21492.
         modules/experimental/mod_disk_cache.c?r1=1.63&r2=1.64
       +1: stoddard, jerenkrantz, minfrin, jim

    *) Try to correctly follow RFC 2616 13.3 on validating stale cache
       responses by teaching mod_cache's cache_select_url and
       cache_save_filter how to deal with this corner case.
+16 −0
Original line number Diff line number Diff line
@@ -704,6 +704,22 @@ static apr_status_t store_body(cache_handle_t *h, request_rec *r,
     */
    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;
        }