From e0f539c4383952611cb27cc90830ff84458e6450 Mon Sep 17 00:00:00 2001 From: Christophe Jaillet Date: Fri, 6 Jan 2017 13:58:03 +0000 Subject: [PATCH] Move definition of ASCII_ZERO to httpd.h and rename it ZERO_ASCII for consistancy reason. Remove definition of ASCII_CRLF which is the same as CRLF_ASCII. Use ZERO_ASCII and CRLF_ASCII in mod_proxy_http git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1777611 13f79535-47bb-0310-9956-ffa450edef68 --- include/httpd.h | 1 + modules/proxy/mod_proxy_http.c | 17 +++++++---------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/include/httpd.h b/include/httpd.h index dec6706bd9..ebb2a15b4c 100644 --- a/include/httpd.h +++ b/include/httpd.h @@ -690,6 +690,7 @@ struct ap_method_list_t { #endif /* APR_CHARSET_EBCDIC */ /** Useful for common code with either platform charset. */ #define CRLF_ASCII "\015\012" +#define ZERO_ASCII "\060" /** * @defgroup values_request_rec_body Possible values for request_rec.read_body diff --git a/modules/proxy/mod_proxy_http.c b/modules/proxy/mod_proxy_http.c index ae6384424c..fc9c044021 100644 --- a/modules/proxy/mod_proxy_http.c +++ b/modules/proxy/mod_proxy_http.c @@ -213,16 +213,13 @@ static void add_cl(apr_pool_t *p, APR_BRIGADE_INSERT_TAIL(header_brigade, e); } -#define ASCII_CRLF "\015\012" -#define ASCII_ZERO "\060" - static void terminate_headers(apr_bucket_alloc_t *bucket_alloc, apr_bucket_brigade *header_brigade) { apr_bucket *e; /* add empty line at the end of the headers */ - e = apr_bucket_immortal_create(ASCII_CRLF, 2, bucket_alloc); + e = apr_bucket_immortal_create(CRLF_ASCII, 2, bucket_alloc); APR_BRIGADE_INSERT_TAIL(header_brigade, e); } @@ -281,7 +278,7 @@ static int stream_reqbody_chunked(apr_pool_t *p, /* * Append the end-of-chunk CRLF */ - e = apr_bucket_immortal_create(ASCII_CRLF, 2, bucket_alloc); + e = apr_bucket_immortal_create(CRLF_ASCII, 2, bucket_alloc); APR_BRIGADE_INSERT_TAIL(input_brigade, e); } @@ -357,14 +354,14 @@ static int stream_reqbody_chunked(apr_pool_t *p, bb = input_brigade; } - e = apr_bucket_immortal_create(ASCII_ZERO ASCII_CRLF + e = apr_bucket_immortal_create(ZERO_ASCII CRLF_ASCII /* */ - ASCII_CRLF, + CRLF_ASCII, 5, bucket_alloc); APR_BRIGADE_INSERT_TAIL(bb, e); if (apr_table_get(r->subprocess_env, "proxy-sendextracrlf")) { - e = apr_bucket_immortal_create(ASCII_CRLF, 2, bucket_alloc); + e = apr_bucket_immortal_create(CRLF_ASCII, 2, bucket_alloc); APR_BRIGADE_INSERT_TAIL(bb, e); } @@ -426,7 +423,7 @@ static int stream_reqbody_cl(apr_pool_t *p, apr_bucket_delete(e); if (apr_table_get(r->subprocess_env, "proxy-sendextracrlf")) { - e = apr_bucket_immortal_create(ASCII_CRLF, 2, + e = apr_bucket_immortal_create(CRLF_ASCII, 2, bucket_alloc); APR_BRIGADE_INSERT_TAIL(input_brigade, e); } @@ -665,7 +662,7 @@ static int spool_reqbody_cl(apr_pool_t *p, apr_brigade_insert_file(header_brigade, tmpfile, 0, fsize, p); } if (apr_table_get(r->subprocess_env, "proxy-sendextracrlf")) { - e = apr_bucket_immortal_create(ASCII_CRLF, 2, bucket_alloc); + e = apr_bucket_immortal_create(CRLF_ASCII, 2, bucket_alloc); APR_BRIGADE_INSERT_TAIL(header_brigade, e); } return OK; -- 2.40.0