]> granicus.if.org Git - apache/commitdiff
* Use new ap_proxy_buckets_lifetime_transform
authorRuediger Pluem <rpluem@apache.org>
Tue, 26 Jan 2016 12:20:33 +0000 (12:20 +0000)
committerRuediger Pluem <rpluem@apache.org>
Tue, 26 Jan 2016 12:20:33 +0000 (12:20 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1726782 13f79535-47bb-0310-9956-ffa450edef68

modules/proxy/mod_proxy_http.c

index 52b444e69bfa4918322f91b9b911170d26b3cb57..0418b08af0d0dc4906d47250a72bfaf970aca3d8 100644 (file)
@@ -671,56 +671,6 @@ static int spool_reqbody_cl(apr_pool_t *p,
     return OK;
 }
 
-/*
- * 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_bucket_alloc_t *bucket_alloc = to->bucket_alloc;
-
-    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, bucket_alloc);
-            APR_BRIGADE_INSERT_TAIL(to, new);
-        }
-        else if (APR_BUCKET_IS_FLUSH(e)) {
-            new = apr_bucket_flush_create(bucket_alloc);
-            APR_BRIGADE_INSERT_TAIL(to, new);
-        }
-        else if (APR_BUCKET_IS_EOS(e)) {
-            new = apr_bucket_eos_create(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;
-}
-
 enum rb_methods {
     RB_INIT = 0,
     RB_STREAM_CL,
@@ -1851,7 +1801,7 @@ int 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))) {