]> granicus.if.org Git - apache/commitdiff
Merge r1615026 from trunk:
authorJim Jagielski <jim@apache.org>
Sun, 31 Aug 2014 16:06:36 +0000 (16:06 +0000)
committerJim Jagielski <jim@apache.org>
Sun, 31 Aug 2014 16:06:36 +0000 (16:06 +0000)
Turn some APR_BUCKET_REMOVE(e)+apr_bucket_destroy(e) into the equivalent apr_bucket_delete(e) to reduce code verbosity

Submitted by: jailletc36
Reviewed/backported by: jim

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1621600 13f79535-47bb-0310-9956-ffa450edef68

STATUS
modules/filters/mod_xml2enc.c
modules/http/byterange_filter.c
modules/proxy/mod_proxy_ftp.c
server/core_filters.c
server/util_script.c

diff --git a/STATUS b/STATUS
index e09c244206da6e40239772a95fe4265571a54b29..2f06038ba628189d13548ebb9042046d2c008d2d 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -101,12 +101,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-   * Turn some APR_BUCKET_REMOVE(e)+apr_bucket_destroy(e) into the equivalent
-     apr_bucket_delete(e) to reduce code verbosity
-     trunk patch: http://svn.apache.org/r1615026
-     2.4.x patch: trunk patch works
-     +1: jailletc36, ylavic, covener
-
    * mod_proxy_http: Proxy responses with error status and "ProxyErrorOverride On"
      hang until proxy timeout.  PR53420
      Regression from 2.2. It was introduced by r912063 in order to fix PR41646.
index a4202a288e98fe111da8faf287ee36a65d20f89e..d28c97d1be66fbb2b2728f0dd7e459cbf87d1a7e 100644 (file)
@@ -142,8 +142,7 @@ static void fix_skipto(request_rec* r, xml2ctx* ctx)
                                                &bstart);
                     ap_assert(rv == APR_SUCCESS);
                     while (b = APR_BRIGADE_FIRST(ctx->bbsave), b != bstart) {
-                        APR_BUCKET_REMOVE(b);
-                        apr_bucket_destroy(b);
+                        apr_bucket_delete(b);
                     }
                     ctx->bytes -= (p-ctx->buf);
                     ctx->buf = p ;
@@ -228,8 +227,7 @@ static void sniff_encoding(request_rec* r, xml2ctx* ctx)
         /* cut out the <meta> we're invalidating */
         while (cutb != cute) {
             b = APR_BUCKET_NEXT(cutb);
-            APR_BUCKET_REMOVE(cutb);
-            apr_bucket_destroy(cutb);
+            apr_bucket_delete(cutb);
             cutb = b;
         }
         /* and leave a string */
@@ -435,8 +433,7 @@ static apr_status_t xml2enc_ffunc(ap_filter_t* f, apr_bucket_brigade* bb)
                 /* remove the data we've just read */
                 rv = apr_brigade_partition(bb, bytes, &bstart);
                 while (b = APR_BRIGADE_FIRST(bb), b != bstart) {
-                    APR_BUCKET_REMOVE(b);
-                    apr_bucket_destroy(b);
+                    apr_bucket_delete(b);
                 }
                 ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, f->r, APLOGNO(01438)
                               "xml2enc: consuming %" APR_SIZE_T_FMT
index 09f1956581f5b7cdde24017e884ef986e67e1611..de585c5750c770160ba3868f31f5fae5b47bb4d7 100644 (file)
@@ -380,8 +380,7 @@ static apr_status_t copy_brigade_range(apr_bucket_brigade *bb,
                     return rv;
                 }
                 out_first = APR_BUCKET_NEXT(copy);
-                APR_BUCKET_REMOVE(copy);
-                apr_bucket_destroy(copy);
+                apr_bucket_delete(copy);
             }
             else {
                 out_first = copy;
@@ -400,8 +399,7 @@ static apr_status_t copy_brigade_range(apr_bucket_brigade *bb,
                 }
                 copy = APR_BUCKET_NEXT(copy);
                 if (copy != APR_BRIGADE_SENTINEL(bbout)) {
-                    APR_BUCKET_REMOVE(copy);
-                    apr_bucket_destroy(copy);
+                    apr_bucket_delete(copy);
                 }
             }
             break;
index cf5d51302675094752ad723bd25926542bd7c0e7..8e0805f86bdb59102478ca720ccde77944c346d7 100644 (file)
@@ -275,8 +275,7 @@ static apr_status_t ftp_string_read(conn_rec *c, apr_bucket_brigade *bb,
                     pos += len;
                 }
             }
-            APR_BUCKET_REMOVE(e);
-            apr_bucket_destroy(e);
+            apr_bucket_delete(e);
         }
         *pos = '\0';
     }
@@ -634,8 +633,7 @@ static apr_status_t proxy_send_dir_filter(ap_filter_t *f,
             /* len+1 to leave space for the trailing nil char */
             apr_cpystrn(ctx->buffer+strlen(ctx->buffer), response, len+1);
 
-            APR_BUCKET_REMOVE(e);
-            apr_bucket_destroy(e);
+            apr_bucket_delete(e);
         }
 
         /* EOS? jump to footer */
index 84e11497c1b0da38ae124e62c37a8cecc6ab7865..8700b76d532f417d91fffdbfe803f4d534023ed5 100644 (file)
@@ -718,8 +718,7 @@ static void remove_empty_buckets(apr_bucket_brigade *bb)
     apr_bucket *bucket;
     while (((bucket = APR_BRIGADE_FIRST(bb)) != APR_BRIGADE_SENTINEL(bb)) &&
            (APR_BUCKET_IS_METADATA(bucket) || (bucket->length == 0))) {
-        APR_BUCKET_REMOVE(bucket);
-        apr_bucket_destroy(bucket);
+        apr_bucket_delete(bucket);
     }
 }
 
@@ -792,19 +791,16 @@ static apr_status_t writev_nonblocking(apr_socket_t *s,
             for (i = offset; i < nvec; ) {
                 apr_bucket *bucket = APR_BRIGADE_FIRST(bb);
                 if (APR_BUCKET_IS_METADATA(bucket)) {
-                    APR_BUCKET_REMOVE(bucket);
-                    apr_bucket_destroy(bucket);
+                    apr_bucket_delete(bucket);
                 }
                 else if (n >= vec[i].iov_len) {
-                    APR_BUCKET_REMOVE(bucket);
-                    apr_bucket_destroy(bucket);
+                    apr_bucket_delete(bucket);
                     offset++;
                     n -= vec[i++].iov_len;
                 }
                 else {
                     apr_bucket_split(bucket, n);
-                    APR_BUCKET_REMOVE(bucket);
-                    apr_bucket_destroy(bucket);
+                    apr_bucket_delete(bucket);
                     vec[i].iov_len -= n;
                     vec[i].iov_base = (char *) vec[i].iov_base + n;
                     break;
@@ -883,12 +879,10 @@ static apr_status_t sendfile_nonblocking(apr_socket_t *s,
     *cumulative_bytes_written += bytes_written;
     if ((bytes_written < file_length) && (bytes_written > 0)) {
         apr_bucket_split(bucket, bytes_written);
-        APR_BUCKET_REMOVE(bucket);
-        apr_bucket_destroy(bucket);
+        apr_bucket_delete(bucket);
     }
     else if (bytes_written == file_length) {
-        APR_BUCKET_REMOVE(bucket);
-        apr_bucket_destroy(bucket);
+        apr_bucket_delete(bucket);
     }
     return rv;
 }
index 3bc1b00a638a57c67dbf5227f41c1ed52e7788ec..10f61deef86798604c2a5cd21e6ddda09760a79f 100644 (file)
@@ -704,8 +704,7 @@ static int getsfunc_BRIGADE(char *buf, int len, void *arg)
             apr_bucket_split(e, src - bucket_data);
         }
         next = APR_BUCKET_NEXT(e);
-        APR_BUCKET_REMOVE(e);
-        apr_bucket_destroy(e);
+        apr_bucket_delete(e);
         e = next;
     }
     *dst = 0;