diff -aur httpd-2.2.17/modules/http/http_filters.c httpd-2.2.17.patch50335/modules/http/http_filters.c --- httpd-2.2.17/modules/http/http_filters.c 2010-02-26 12:32:15.000000000 +0300 +++ httpd-2.2.17.patch50335/modules/http/http_filters.c 2010-12-28 19:04:45.000000000 +0300 @@ -312,7 +312,7 @@ * proxied *response*, proxy responses MUST be exempt. */ if (ctx->state == BODY_NONE && f->r->proxyreq != PROXYREQ_RESPONSE) { - e = apr_bucket_eos_create(f->c->bucket_alloc); + e = apr_bucket_eos_create(b->bucket_alloc); APR_BRIGADE_INSERT_TAIL(b, e); ctx->eos_sent = 1; return APR_SUCCESS; @@ -339,7 +339,7 @@ e = apr_bucket_pool_create(tmp, len, f->r->pool, f->c->bucket_alloc); APR_BRIGADE_INSERT_HEAD(bb, e); - e = apr_bucket_flush_create(f->c->bucket_alloc); + e = apr_bucket_flush_create(b->bucket_alloc); APR_BRIGADE_INSERT_TAIL(bb, e); ap_pass_brigade(f->c->output_filters, bb); @@ -389,7 +389,7 @@ /* Handle trailers by calling ap_get_mime_headers again! */ ctx->state = BODY_NONE; ap_get_mime_headers(f->r); - e = apr_bucket_eos_create(f->c->bucket_alloc); + e = apr_bucket_eos_create(b->bucket_alloc); APR_BRIGADE_INSERT_TAIL(b, e); ctx->eos_sent = 1; return APR_SUCCESS; @@ -401,7 +401,7 @@ } if (ctx->eos_sent) { - e = apr_bucket_eos_create(f->c->bucket_alloc); + e = apr_bucket_eos_create(b->bucket_alloc); APR_BRIGADE_INSERT_TAIL(b, e); return APR_SUCCESS; } @@ -411,7 +411,7 @@ case BODY_NONE: break; case BODY_LENGTH: - e = apr_bucket_eos_create(f->c->bucket_alloc); + e = apr_bucket_eos_create(b->bucket_alloc); APR_BRIGADE_INSERT_TAIL(b, e); ctx->eos_sent = 1; return APR_SUCCESS; @@ -491,7 +491,7 @@ /* Handle trailers by calling ap_get_mime_headers again! */ ctx->state = BODY_NONE; ap_get_mime_headers(f->r); - e = apr_bucket_eos_create(f->c->bucket_alloc); + e = apr_bucket_eos_create(b->bucket_alloc); APR_BRIGADE_INSERT_TAIL(b, e); ctx->eos_sent = 1; return APR_SUCCESS; @@ -535,7 +535,7 @@ * save the callter a roundtrip to discover EOS. */ if (ctx->state == BODY_LENGTH && ctx->remaining == 0) { - e = apr_bucket_eos_create(f->c->bucket_alloc); + e = apr_bucket_eos_create(b->bucket_alloc); APR_BRIGADE_INSERT_TAIL(b, e); } diff -aur httpd-2.2.17/modules/proxy/mod_proxy_http.c httpd-2.2.17.patch50335/modules/proxy/mod_proxy_http.c --- httpd-2.2.17/modules/proxy/mod_proxy_http.c 2010-10-06 14:48:13.000000000 +0400 +++ httpd-2.2.17.patch50335/modules/proxy/mod_proxy_http.c 2010-12-28 19:04:45.000000000 +0300 @@ -701,7 +701,7 @@ int force10, rv; apr_table_t *headers_in_copy; - header_brigade = apr_brigade_create(p, origin->bucket_alloc); + header_brigade = apr_brigade_create(p, bucket_alloc); /* * Send the HTTP/1.1 request to the remote server diff -aur httpd-2.2.17/modules/proxy/proxy_util.c httpd-2.2.17.patch50335/modules/proxy/proxy_util.c --- httpd-2.2.17/modules/proxy/proxy_util.c 2010-08-25 18:10:14.000000000 +0400 +++ httpd-2.2.17.patch50335/modules/proxy/proxy_util.c 2010-12-28 19:04:45.000000000 +0300 @@ -344,16 +344,18 @@ PROXY_DECLARE(request_rec *)ap_proxy_make_fake_req(conn_rec *c, request_rec *r) { - request_rec *rp = apr_pcalloc(r->pool, sizeof(*r)); + request_rec *rp = apr_pcalloc(c->pool, sizeof(*r)); + + apr_pool_create(&(rp->pool), c->pool); + apr_pool_tag(rp->pool, "request_fake"); - rp->pool = r->pool; rp->status = HTTP_OK; - rp->headers_in = apr_table_make(r->pool, 50); - rp->subprocess_env = apr_table_make(r->pool, 50); - rp->headers_out = apr_table_make(r->pool, 12); - rp->err_headers_out = apr_table_make(r->pool, 5); - rp->notes = apr_table_make(r->pool, 5); + rp->headers_in = apr_table_make(rp->pool, 50); + rp->subprocess_env = apr_table_make(rp->pool, 50); + rp->headers_out = apr_table_make(rp->pool, 12); + rp->err_headers_out = apr_table_make(rp->pool, 5); + rp->notes = apr_table_make(rp->pool, 5); rp->server = r->server; rp->proxyreq = r->proxyreq; @@ -364,7 +366,7 @@ rp->proto_output_filters = c->output_filters; rp->proto_input_filters = c->input_filters; - rp->request_config = ap_create_request_config(r->pool); + rp->request_config = ap_create_request_config(rp->pool); proxy_run_create_req(r, rp); return rp; diff -aur httpd-2.2.17/server/core_filters.c httpd-2.2.17.patch50335/server/core_filters.c --- httpd-2.2.17/server/core_filters.c 2010-02-26 12:32:15.000000000 +0300 +++ httpd-2.2.17.patch50335/server/core_filters.c 2010-12-28 19:04:45.000000000 +0300 @@ -230,7 +230,7 @@ * so tack on an EOS too. */ /* We have read until the brigade was empty, so we know that we * must be EOS. */ - e = apr_bucket_eos_create(f->c->bucket_alloc); + e = apr_bucket_eos_create(b->bucket_alloc); APR_BRIGADE_INSERT_TAIL(b, e); return APR_SUCCESS; } @@ -262,7 +262,7 @@ apr_bucket_delete(e); if (mode == AP_MODE_READBYTES) { - e = apr_bucket_eos_create(f->c->bucket_alloc); + e = apr_bucket_eos_create(b->bucket_alloc); APR_BRIGADE_INSERT_TAIL(b, e); } return APR_SUCCESS; @@ -655,8 +655,8 @@ /* Create a temporary brigade as a means * of concatenating a bunch of buckets together */ - temp_brig = apr_brigade_create(f->c->pool, - f->c->bucket_alloc); + temp_brig = apr_brigade_create(b->p, + b->bucket_alloc); if (last_merged_bucket) { /* If we've concatenated together small * buckets already in a previous pass, diff -aur httpd-2.2.17/srclib/apr-util/buckets/apr_brigade.c httpd-2.2.17.patch50335/srclib/apr-util/buckets/apr_brigade.c --- httpd-2.2.17/srclib/apr-util/buckets/apr_brigade.c 2010-10-01 15:43:26.000000000 +0400 +++ httpd-2.2.17.patch50335/srclib/apr-util/buckets/apr_brigade.c 2010-12-28 19:03:38.000000000 +0300 @@ -327,12 +327,20 @@ if (pos != NULL) { apr_bucket_split(e, pos - str + 1); APR_BUCKET_REMOVE(e); - APR_BRIGADE_INSERT_TAIL(bbOut, e); + rv = apr_brigade_write(bbOut, NULL, NULL, str, pos - str + 1); + if (rv != APR_SUCCESS) { + return rv; + } + apr_bucket_destroy(e); return APR_SUCCESS; } APR_BUCKET_REMOVE(e); - if (APR_BUCKET_IS_METADATA(e) || len > APR_BUCKET_BUFF_SIZE/4) { - APR_BRIGADE_INSERT_TAIL(bbOut, e); + if (APR_BUCKET_IS_EOS(e)) { + apr_bucket *b = apr_bucket_eos_create(bbOut->bucket_alloc); + APR_BRIGADE_INSERT_TAIL(bbOut, b); + } else if (APR_BUCKET_IS_FLUSH(e)) { + apr_bucket *b = apr_bucket_flush_create(bbOut->bucket_alloc); + APR_BRIGADE_INSERT_TAIL(bbOut, b); } else { if (len > 0) { @@ -341,8 +349,8 @@ return rv; } } - apr_bucket_destroy(e); } + apr_bucket_destroy(e); readbytes += len; /* We didn't find an APR_ASCII_LF within the maximum line length. */ if (readbytes >= maxbytes) {