| 5184 | } |
| 5185 | |
| 5186 | PROXY_DECLARE(apr_status_t) ap_proxy_buckets_lifetime_transform(request_rec *r, |
| 5187 | apr_bucket_brigade *from, |
| 5188 | apr_bucket_brigade *to) |
| 5189 | { |
| 5190 | apr_bucket *e; |
| 5191 | apr_bucket *new; |
| 5192 | const char *data; |
| 5193 | apr_size_t bytes; |
| 5194 | apr_status_t rv = APR_SUCCESS; |
| 5195 | apr_bucket_alloc_t *bucket_alloc = to->bucket_alloc; |
| 5196 | |
| 5197 | apr_brigade_cleanup(to); |
| 5198 | for (e = APR_BRIGADE_FIRST(from); |
| 5199 | e != APR_BRIGADE_SENTINEL(from); |
| 5200 | e = APR_BUCKET_NEXT(e)) { |
| 5201 | if (!APR_BUCKET_IS_METADATA(e)) { |
| 5202 | apr_bucket_read(e, &data, &bytes, APR_BLOCK_READ); |
| 5203 | new = apr_bucket_transient_create(data, bytes, bucket_alloc); |
| 5204 | APR_BRIGADE_INSERT_TAIL(to, new); |
| 5205 | } |
| 5206 | else if (APR_BUCKET_IS_FLUSH(e)) { |
| 5207 | new = apr_bucket_flush_create(bucket_alloc); |
| 5208 | APR_BRIGADE_INSERT_TAIL(to, new); |
| 5209 | } |
| 5210 | else if (APR_BUCKET_IS_EOS(e)) { |
| 5211 | new = apr_bucket_eos_create(bucket_alloc); |
| 5212 | APR_BRIGADE_INSERT_TAIL(to, new); |
| 5213 | } |
| 5214 | else { |
| 5215 | ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(03304) |
| 5216 | "Unhandled bucket type of type %s in" |
| 5217 | " ap_proxy_buckets_lifetime_transform", e->type->name); |
| 5218 | rv = APR_EGENERAL; |
| 5219 | } |
| 5220 | } |
| 5221 | return rv; |
| 5222 | } |
| 5223 | |
| 5224 | /* An arbitrary large value to address pathological case where we keep |
| 5225 | * reading from one side only, without scheduling the other direction for |
no outgoing calls
no test coverage detected