* ap_recent_ctime_ex().
* 20100609.0 (2.3.6-dev) Dropped ap_args_to_table due to missing constraints.
* 20100609.1 (2.3.7-dev) Introduce ap_log_cserror()
+ * 20100609.2 (2.3.7-dev) Add deferred write pool to core_output_filter_ctx
*/
#define MODULE_MAGIC_COOKIE 0x41503234UL /* "AP24" */
#ifndef MODULE_MAGIC_NUMBER_MAJOR
#define MODULE_MAGIC_NUMBER_MAJOR 20100609
#endif
-#define MODULE_MAGIC_NUMBER_MINOR 1 /* 0...n */
+#define MODULE_MAGIC_NUMBER_MINOR 2 /* 0...n */
/**
* Determine if the server's current MODULE_MAGIC_NUMBER is at least a
* allocated from bb->pool which might be wrong.
*/
ctx->tmp_flush_bb = apr_brigade_create(c->pool, c->bucket_alloc);
+ /* same for buffered_bb and ap_save_brigade */
+ ctx->buffered_bb = apr_brigade_create(c->pool, c->bucket_alloc);
}
if (new_bb != NULL) {
return APR_SUCCESS;
}
+/*
+ * This function assumes that either ctx->buffered_bb == NULL, or
+ * ctx->buffered_bb is empty, or ctx->buffered_bb == bb
+ */
static void setaside_remaining_output(ap_filter_t *f,
core_output_filter_ctx_t *ctx,
apr_bucket_brigade *bb,
if (!APR_BRIGADE_EMPTY(bb)) {
c->data_in_output_filters = 1;
if (bb != ctx->buffered_bb) {
- /* XXX should this use a separate deferred write pool, like
- * the original ap_core_output_filter?
- */
- ap_save_brigade(f, &(ctx->buffered_bb), &bb, c->pool);
+ if (!ctx->deferred_write_pool) {
+ apr_pool_create(&ctx->deferred_write_pool, c->pool);
+ apr_pool_tag(ctx->deferred_write_pool, "deferred_write");
+ }
+ ap_save_brigade(f, &(ctx->buffered_bb), &bb,
+ ctx->deferred_write_pool);
apr_brigade_cleanup(bb);
}
}
+ else if (ctx->deferred_write_pool) {
+ /*
+ * There are no more requests in the pipeline. We can just clear the
+ * pool.
+ */
+ apr_pool_clear(ctx->deferred_write_pool);
+ }
}
#ifndef APR_MAX_IOVEC_SIZE