summaryrefslogtreecommitdiff
path: root/modules/experimental
diff options
context:
space:
mode:
authorJim Jagielski <jim@apache.org>2007-03-19 20:04:56 +0000
committerJim Jagielski <jim@apache.org>2007-03-19 20:04:56 +0000
commit053638a8f032344f6494c3f156ebe1cf01090a5a (patch)
tree1895cf0588ddc4479002be297f45a8b2e774de2d /modules/experimental
parent3bf99c1314451613a88f8b1b43a83335e650df3c (diff)
downloadhttpd-053638a8f032344f6494c3f156ebe1cf01090a5a.tar.gz
Some minor tweaks... return quickly if given an
empty bb, ensure EOS is the last bucket we handle and if our chunked passing fails, then we need to report that immediately. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@520074 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/experimental')
-rw-r--r--modules/experimental/mod_sedfilter.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/modules/experimental/mod_sedfilter.c b/modules/experimental/mod_sedfilter.c
index c93d0db4b7..13a96b538d 100644
--- a/modules/experimental/mod_sedfilter.c
+++ b/modules/experimental/mod_sedfilter.c
@@ -277,6 +277,7 @@ static apr_status_t sed_filter(ap_filter_t *f, apr_bucket_brigade *bb)
apr_status_t rv;
sed_module_ctx *ctx = f->ctx;
+
/*
* First time around? Create the saved bb that we used for each pass
* through. Note that we can also get here when we explicitly clear ctx,
@@ -289,6 +290,12 @@ static apr_status_t sed_filter(ap_filter_t *f, apr_bucket_brigade *bb)
}
/*
+ * Shortcircuit processing
+ */
+ if (APR_BRIGADE_EMPTY(bb))
+ return APR_SUCCESS;
+
+ /*
* Everything to be passed to the next filter goes in
* here, our pass brigade.
*/
@@ -323,8 +330,10 @@ static apr_status_t sed_filter(ap_filter_t *f, apr_bucket_brigade *bb)
while ((b = APR_BRIGADE_FIRST(bb)) && (b != APR_BRIGADE_SENTINEL(bb))) {
apr_brigade_length(passbb, 0, &blen);
if ((blen != -1) && (blen > AP_MIN_BYTES_TO_WRITE)) {
- ap_pass_brigade(f->next, passbb);
+ rv = ap_pass_brigade(f->next, passbb);
apr_brigade_cleanup(passbb);
+ if (rv != APR_SUCCESS)
+ return rv;
}
if (APR_BUCKET_IS_EOS(b)) {
/*
@@ -342,6 +351,7 @@ static apr_status_t sed_filter(ap_filter_t *f, apr_bucket_brigade *bb)
apr_brigade_cleanup(ctx->ctxbb);
APR_BUCKET_REMOVE(b);
APR_BRIGADE_INSERT_TAIL(passbb, b);
+ break;
}
else if (APR_BUCKET_IS_METADATA(b)) {
APR_BUCKET_REMOVE(b);