Changes with Apache 2.3.3
+ *) core: Lower memory usage of core output filter.
+ [Stefan Fritsch <sf sfritsch.de>]
+
*) mod_mime: Detect invalid use of MultiviewsMatch inside Location and
LocationMatch sections. PR47754. [Dan Poirier]
* ap_my_generation, etc. ap_mpm_query() can't be called
* until after the register-hooks phase.
* 20090401.1 (2.3.3-dev) Protected log.c internals, http_log.h changes
+ * 20090401.2 (2.3.3-dev) Added tmp_flush_bb to core_output_filter_ctx_t
+ *
*/
#define MODULE_MAGIC_COOKIE 0x41503234UL /* "AP24" */
#ifndef MODULE_MAGIC_NUMBER_MAJOR
#define MODULE_MAGIC_NUMBER_MAJOR 20090401
#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
apr_bucket_brigade *buffered_bb;
apr_size_t bytes_in;
apr_size_t bytes_written;
+ apr_bucket_brigade *tmp_flush_bb;
} core_output_filter_ctx_t;
typedef struct core_filter_ctx {
if (rv != APR_SUCCESS) {
return rv;
}
+ /*
+ * Need to create tmp brigade with correct lifetime. Passing
+ * NULL to apr_brigade_split_ex would result in a brigade
+ * allocated from bb->pool which might be wrong.
+ */
+ ctx->tmp_flush_bb = apr_brigade_create(c->pool, c->bucket_alloc);
}
if (new_bb != NULL) {
bucket = next) {
next = APR_BUCKET_NEXT(bucket);
if (APR_BUCKET_IS_FLUSH(bucket)) {
- apr_bucket_brigade *remainder = apr_brigade_split(bb, next);
+ ctx->tmp_flush_bb = apr_brigade_split_ex(bb, next, ctx->tmp_flush_bb);
apr_status_t rv = send_brigade_blocking(net->client_socket, bb,
&(ctx->bytes_written), c);
if (rv != APR_SUCCESS) {
c->aborted = 1;
return rv;
}
- bb = remainder;
+ APR_BRIGADE_CONCAT(bb, ctx->tmp_flush_bb);
next = APR_BRIGADE_FIRST(bb);
bytes_in_brigade = 0;
non_file_bytes_in_brigade = 0;