You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by mi...@apache.org on 2010/09/14 00:35:51 UTC
svn commit: r996713 - in /httpd/httpd/trunk/modules/cache: mod_disk_cache.c
mod_disk_cache.h
Author: minfrin
Date: Mon Sep 13 22:35:51 2010
New Revision: 996713
URL: http://svn.apache.org/viewvc?rev=996713&view=rev
Log:
Handle the case where a brigade might have buckets following the eos
bucket. In this case the cache provider passes all buckets through as
is once the cached entry is marked as done.
Modified:
httpd/httpd/trunk/modules/cache/mod_disk_cache.c
httpd/httpd/trunk/modules/cache/mod_disk_cache.h
Modified: httpd/httpd/trunk/modules/cache/mod_disk_cache.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/cache/mod_disk_cache.c?rev=996713&r1=996712&r2=996713&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/cache/mod_disk_cache.c (original)
+++ httpd/httpd/trunk/modules/cache/mod_disk_cache.c Mon Sep 13 22:35:51 2010
@@ -1051,13 +1051,21 @@ static apr_status_t store_body(cache_han
e = APR_BRIGADE_FIRST(in);
+ /* are we done completely? if so, pass any trailing buckets right through */
+ if (dobj->done) {
+ APR_BUCKET_REMOVE(e);
+ APR_BRIGADE_INSERT_TAIL(out, e);
+ continue;
+ }
+
/* have we seen eos yet? */
if (APR_BUCKET_IS_EOS(e)) {
seen_eos = 1;
+ dobj->done = 1;
APR_BUCKET_REMOVE(e);
APR_BRIGADE_CONCAT(out, dobj->bb);
APR_BRIGADE_INSERT_TAIL(out, e);
- continue;
+ break;
}
/* honour flush buckets, we'll get called again */
Modified: httpd/httpd/trunk/modules/cache/mod_disk_cache.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/cache/mod_disk_cache.h?rev=996713&r1=996712&r2=996713&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/cache/mod_disk_cache.h (original)
+++ httpd/httpd/trunk/modules/cache/mod_disk_cache.h Mon Sep 13 22:35:51 2010
@@ -73,6 +73,7 @@ typedef struct disk_cache_object {
apr_bucket_brigade *bb; /* Set aside brigade */
apr_off_t offset; /* Max size to set aside */
apr_time_t timeout; /* Max time to set aside */
+ int done; /* Is the attempt to cache complete? */
} disk_cache_object_t;