]> granicus.if.org Git - apache/commitdiff
util_filter: Axe conn_rec->empty brigade.
authorYann Ylavic <ylavic@apache.org>
Mon, 16 Jul 2018 11:20:26 +0000 (11:20 +0000)
committerYann Ylavic <ylavic@apache.org>
Mon, 16 Jul 2018 11:20:26 +0000 (11:20 +0000)
Since it's internal util_filter use, we shouldn't expose it in conn_rec and
can replace it with a pooled brigade provided by ap_reuse_brigade_from_pool().

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1836020 13f79535-47bb-0310-9956-ffa450edef68

include/ap_mmn.h
include/httpd.h
server/core.c
server/util_filter.c

index 87d6854161d880dd50483d5ebb2a8fa728cb6d0e..357c909cb411c778f2018867b7e9db403f2d2828 100644 (file)
  *                         conn_rec, and add ring entry 'pending' in struct
  *                         ap_filter_t
  * 20180711.2 (2.5.1-dev)  Add ap_reuse_brigade_from_pool()
+ * 20180716.1 (2.5.1-dev)  Axe conn_rec->empty brigade
  */
 
 #define MODULE_MAGIC_COOKIE 0x41503235UL /* "AP25" */
 
 #ifndef MODULE_MAGIC_NUMBER_MAJOR
-#define MODULE_MAGIC_NUMBER_MAJOR 20180711
+#define MODULE_MAGIC_NUMBER_MAJOR 20180716
 #endif
-#define MODULE_MAGIC_NUMBER_MINOR 2                 /* 0...n */
+#define MODULE_MAGIC_NUMBER_MINOR 1                 /* 0...n */
 
 /**
  * Determine if the server's current MODULE_MAGIC_NUMBER is at least a
index cf84d5fb73acb4be6d91fa0f4538c518f88e2998..22b1a99ebcd6d883ba9d3151cab8b396b5b4b5e9 100644 (file)
@@ -1221,9 +1221,6 @@ struct conn_rec {
     /** Array of requests being handled under this connection. */
     apr_array_header_t *requests;
 
-    /** Empty bucket brigade */
-    apr_bucket_brigade *empty;
-
     /** Ring of pending filters (with setaside buckets) */
     struct ap_filter_ring *pending_filters;
 
index 5d2961d8d0512551633a9c28ca583e050e199c44..d928ba2263945e7704436ab2808fd8e99c7fd968 100644 (file)
@@ -5325,7 +5325,6 @@ static conn_rec *core_create_conn(apr_pool_t *ptrans, server_rec *s,
 
     c->id = id;
     c->bucket_alloc = alloc;
-    c->empty = apr_brigade_create(c->pool, c->bucket_alloc);
     c->async_filter = sconf->async_filter;
 
     c->clogging_input_filters = 0;
index ff36a13553aa348ad64c96920308462e52ad3cc6..5474c31da1bd3ce83880503489368e6aed79c11a 100644 (file)
@@ -1002,12 +1002,16 @@ AP_DECLARE(int) ap_filter_should_yield(ap_filter_t *f)
 AP_DECLARE_NONSTD(int) ap_filter_output_pending(conn_rec *c)
 {
     int data_in_output_filters = DECLINED;
+    apr_bucket_brigade *bb;
     ap_filter_t *f;
 
     if (!c->pending_filters) {
         return DECLINED;
     }
 
+    bb = ap_reuse_brigade_from_pool("ap_fop_bb", c->pool,
+                                    c->bucket_alloc);
+
     for (f = APR_RING_FIRST(c->pending_filters);
          f != APR_RING_SENTINEL(c->pending_filters, ap_filter_t, pending);
          f = APR_RING_NEXT(f, pending)) {
@@ -1015,9 +1019,10 @@ AP_DECLARE_NONSTD(int) ap_filter_output_pending(conn_rec *c)
                 && !APR_BRIGADE_EMPTY(f->bb)) {
             apr_status_t rv;
 
-            rv = ap_pass_brigade(f, c->empty);
-            apr_brigade_cleanup(c->empty);
-            if (rv != APR_SUCCESS && !APR_STATUS_IS_EAGAIN(rv)) {
+            rv = ap_pass_brigade(f, bb);
+            apr_brigade_cleanup(bb);
+
+            if (rv != APR_SUCCESS) {
                 ap_log_cerror(APLOG_MARK, APLOG_DEBUG, rv, c, APLOGNO(00470)
                         "write failure in '%s' output filter", f->frec->name);
                 return rv;