Index: modules/filters/mod_xml2enc.c =================================================================== --- modules/filters/mod_xml2enc.c (revision 1826784) +++ modules/filters/mod_xml2enc.c (working copy) @@ -399,15 +399,14 @@ static apr_status_t xml2enc_ffunc(ap_filter_t* f, while (b = APR_BRIGADE_FIRST(bb), b != APR_BRIGADE_SENTINEL(bb)) { ctx->bytes = 0; if (APR_BUCKET_IS_METADATA(b)) { + /* passing meta bucket down the chain */ APR_BUCKET_REMOVE(b); + APR_BRIGADE_INSERT_TAIL(ctx->bbnext, b); if (APR_BUCKET_IS_EOS(b)) { - /* send remaining data */ - APR_BRIGADE_INSERT_TAIL(ctx->bbnext, b); - return ap_fflush(f->next, ctx->bbnext); - } else if (APR_BUCKET_IS_FLUSH(b)) { - ap_fflush(f->next, ctx->bbnext); + ap_remove_output_filter(f); } - apr_bucket_destroy(b); + rv = ap_pass_brigade(f->next, ctx->bbnext); + apr_brigade_cleanup(ctx->bbnext); } else { /* data bucket */ char* buf; @@ -514,8 +513,6 @@ static apr_status_t xml2enc_ffunc(ap_filter_t* f, if (rv != APR_SUCCESS) ap_log_rerror(APLOG_MARK, APLOG_DEBUG, rv, f->r, APLOGNO(01446) "ap_fflush failed"); - else - rv = ap_pass_brigade(f->next, ctx->bbnext); } } } else { @@ -524,9 +521,9 @@ static apr_status_t xml2enc_ffunc(ap_filter_t* f, } if (bdestroy) apr_bucket_destroy(bdestroy); - if (rv != APR_SUCCESS) - return rv; } + if (rv != APR_SUCCESS) + return rv; } return APR_SUCCESS; }