httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jerenkra...@apache.org
Subject svn commit: r595067 - /httpd/sandbox/amsterdam/d/modules/proxy/mod_serf.c
Date Wed, 14 Nov 2007 21:24:18 GMT
Author: jerenkrantz
Date: Wed Nov 14 13:24:16 2007
New Revision: 595067

URL: http://svn.apache.org/viewvc?rev=595067&view=rev
Log:
Amsterdam sandbox: Move brigade conversion inside brigade_create() and append
the Serf brigade bucket type to our current bucket.

(With some minor formatting nits.)

Modified:
    httpd/sandbox/amsterdam/d/modules/proxy/mod_serf.c

Modified: httpd/sandbox/amsterdam/d/modules/proxy/mod_serf.c
URL: http://svn.apache.org/viewvc/httpd/sandbox/amsterdam/d/modules/proxy/mod_serf.c?rev=595067&r1=595066&r2=595067&view=diff
==============================================================================
--- httpd/sandbox/amsterdam/d/modules/proxy/mod_serf.c (original)
+++ httpd/sandbox/amsterdam/d/modules/proxy/mod_serf.c Wed Nov 14 13:24:16 2007
@@ -403,7 +403,9 @@
     ctx->allocator = core_ctx->serf_bkt_alloc;
     ctx->pool = serf_bucket_allocator_get_pool(ctx->allocator);
     ctx->core_ctx = core_ctx;
-    ctx->bb = bb;
+
+    /* Replace witha more optimized mechanism for converting */
+    ap_save_brigade(f, &ctx->bb, bb, f->c->pool);
     ctx->tmp_bb = apr_brigade_create(f->c->pool, f->c->bucket_alloc);
 
     return serf_bucket_create(&serf_bucket_type_brigade, ctx->allocator, ctx);
@@ -557,27 +559,20 @@
     }
 
     if (new_bb) {
-        ap_save_brigade(f, &ctx->tmp_brigade, &new_bb, c->pool);
-
-        APR_BRIGADE_CONCAT(ctx->out_brigade, ctx->tmp_brigade);
-        b = brigade_create(f,
-                           ctx->out_brigade,
-                           ctx);
+        b = brigade_create(f, new_bb, ctx);
+        serf_bucket_aggregate_append(ctx->serf_out_bucket, b);
         c->data_in_output_filters = 1;
-        apr_brigade_cleanup(ctx->out_brigade);
     }
 
-    if (c->data_in_output_filters && new_bb  == NULL) {
+    if (c->data_in_output_filters && new_bb == NULL) {
         do {
             apr_status_t srv;
             const char *buf;
             apr_size_t len = 0;
 
-            srv = serf_bucket_read(ctx->serf_out_bucket,
-                                  SERF_READ_ALL_AVAIL,
-                                  &buf,
-                                  &len);
-        
+            srv = serf_bucket_read(ctx->serf_out_bucket, SERF_READ_ALL_AVAIL,
+                                   &buf, &len);
+
             if (SERF_BUCKET_READ_ERROR(srv)) {
                 /* bad, logme */
                 return srv;
@@ -593,7 +588,7 @@
                     srv = APR_SUCCESS;
                 }
             }
-            
+
             if (APR_STATUS_IS_EOF(srv)) {
                 c->data_in_output_filters = 0;
                 break;



Mime
View raw message