diff options
Diffstat (limited to 'modules/proxy/mod_proxy_http.c')
-rw-r--r-- | modules/proxy/mod_proxy_http.c | 61 |
1 files changed, 6 insertions, 55 deletions
diff --git a/modules/proxy/mod_proxy_http.c b/modules/proxy/mod_proxy_http.c index 5e95ea2f..de8b8c80 100644 --- a/modules/proxy/mod_proxy_http.c +++ b/modules/proxy/mod_proxy_http.c @@ -644,55 +644,6 @@ static int spool_reqbody_cl(apr_pool_t *p, return(ap_proxy_pass_brigade(bucket_alloc, r, p_conn, origin, header_brigade, 1)); } -/* - * Transform buckets from one bucket allocator to another one by creating a - * transient bucket for each data bucket and let it use the data read from - * the old bucket. Metabuckets are transformed by just recreating them. - * Attention: Currently only the following bucket types are handled: - * - * All data buckets - * FLUSH - * EOS - * - * If an other bucket type is found its type is logged as a debug message - * and APR_EGENERAL is returned. - */ -static apr_status_t proxy_buckets_lifetime_transform(request_rec *r, - apr_bucket_brigade *from, apr_bucket_brigade *to) -{ - apr_bucket *e; - apr_bucket *new; - const char *data; - apr_size_t bytes; - apr_status_t rv = APR_SUCCESS; - - apr_brigade_cleanup(to); - for (e = APR_BRIGADE_FIRST(from); - e != APR_BRIGADE_SENTINEL(from); - e = APR_BUCKET_NEXT(e)) { - if (!APR_BUCKET_IS_METADATA(e)) { - apr_bucket_read(e, &data, &bytes, APR_BLOCK_READ); - new = apr_bucket_transient_create(data, bytes, r->connection->bucket_alloc); - APR_BRIGADE_INSERT_TAIL(to, new); - } - else if (APR_BUCKET_IS_FLUSH(e)) { - new = apr_bucket_flush_create(r->connection->bucket_alloc); - APR_BRIGADE_INSERT_TAIL(to, new); - } - else if (APR_BUCKET_IS_EOS(e)) { - new = apr_bucket_eos_create(r->connection->bucket_alloc); - APR_BRIGADE_INSERT_TAIL(to, new); - } - else { - ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(00964) - "Unhandled bucket type of type %s in" - " proxy_buckets_lifetime_transform", e->type->name); - rv = APR_EGENERAL; - } - } - return rv; -} - static int ap_proxy_http_request(apr_pool_t *p, request_rec *r, proxy_conn_rec *p_conn, proxy_worker *worker, @@ -1061,7 +1012,6 @@ static void process_proxy_header(request_rec *r, proxy_dir_conf *c, } } apr_table_add(r->headers_out, key, value); - return; } /* @@ -1132,10 +1082,11 @@ static void ap_proxy_read_headers(request_rec *r, request_rec *rr, r->uri, r->method); *pread_len = len; return; - } else { - ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r, APLOGNO(01099) - "No HTTP headers returned by %s (%s)", - r->uri, r->method); + } + else { + ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r, APLOGNO(01099) + "No HTTP headers returned by %s (%s)", + r->uri, r->method); return; } } @@ -1779,7 +1730,7 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r, } /* Switch the allocator lifetime of the buckets */ - proxy_buckets_lifetime_transform(r, bb, pass_bb); + ap_proxy_buckets_lifetime_transform(r, bb, pass_bb); /* found the last brigade? */ if (APR_BUCKET_IS_EOS(APR_BRIGADE_LAST(pass_bb))) { |