You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ja...@apache.org on 2014/08/01 06:23:50 UTC
svn commit: r1615026 - in /httpd/httpd/trunk: modules/filters/mod_xml2enc.c
modules/http/byterange_filter.c modules/proxy/mod_proxy_ftp.c
server/core_filters.c server/util_script.c
Author: jailletc36
Date: Fri Aug 1 04:23:50 2014
New Revision: 1615026
URL: http://svn.apache.org/r1615026
Log:
Trun some APR_BUCKET_REMOVE(e)+apr_bucket_destroy(e) into the equivalent apr_bucket_delete(e) to reduce code verbosity
Modified:
httpd/httpd/trunk/modules/filters/mod_xml2enc.c
httpd/httpd/trunk/modules/http/byterange_filter.c
httpd/httpd/trunk/modules/proxy/mod_proxy_ftp.c
httpd/httpd/trunk/server/core_filters.c
httpd/httpd/trunk/server/util_script.c
Modified: httpd/httpd/trunk/modules/filters/mod_xml2enc.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/filters/mod_xml2enc.c?rev=1615026&r1=1615025&r2=1615026&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/filters/mod_xml2enc.c (original)
+++ httpd/httpd/trunk/modules/filters/mod_xml2enc.c Fri Aug 1 04:23:50 2014
@@ -142,8 +142,7 @@ static void fix_skipto(request_rec* r, x
&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*
/* 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_fil
/* 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
Modified: httpd/httpd/trunk/modules/http/byterange_filter.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http/byterange_filter.c?rev=1615026&r1=1615025&r2=1615026&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http/byterange_filter.c (original)
+++ httpd/httpd/trunk/modules/http/byterange_filter.c Fri Aug 1 04:23:50 2014
@@ -350,8 +350,7 @@ static apr_status_t copy_brigade_range(a
return rv;
}
out_first = APR_BUCKET_NEXT(copy);
- APR_BUCKET_REMOVE(copy);
- apr_bucket_destroy(copy);
+ apr_bucket_delete(copy);
}
else {
out_first = copy;
@@ -370,8 +369,7 @@ static apr_status_t copy_brigade_range(a
}
copy = APR_BUCKET_NEXT(copy);
if (copy != APR_BRIGADE_SENTINEL(bbout)) {
- APR_BUCKET_REMOVE(copy);
- apr_bucket_destroy(copy);
+ apr_bucket_delete(copy);
}
}
break;
Modified: httpd/httpd/trunk/modules/proxy/mod_proxy_ftp.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy_ftp.c?rev=1615026&r1=1615025&r2=1615026&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy_ftp.c (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy_ftp.c Fri Aug 1 04:23:50 2014
@@ -275,8 +275,7 @@ static apr_status_t ftp_string_read(conn
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_filte
/* 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 */
Modified: httpd/httpd/trunk/server/core_filters.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/core_filters.c?rev=1615026&r1=1615025&r2=1615026&view=diff
==============================================================================
--- httpd/httpd/trunk/server/core_filters.c (original)
+++ httpd/httpd/trunk/server/core_filters.c Fri Aug 1 04:23:50 2014
@@ -750,8 +750,7 @@ static void remove_empty_buckets(apr_buc
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);
}
}
@@ -824,19 +823,16 @@ static apr_status_t writev_nonblocking(a
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;
@@ -915,12 +911,10 @@ static apr_status_t sendfile_nonblocking
*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;
}
Modified: httpd/httpd/trunk/server/util_script.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/util_script.c?rev=1615026&r1=1615025&r2=1615026&view=diff
==============================================================================
--- httpd/httpd/trunk/server/util_script.c (original)
+++ httpd/httpd/trunk/server/util_script.c Fri Aug 1 04:23:50 2014
@@ -705,8 +705,7 @@ static int getsfunc_BRIGADE(char *buf, i
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;