Commit 3e1fa9ad authored by Christophe Jaillet's avatar Christophe Jaillet
Browse files

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
parent 639df413
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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
+7 −10
Original line number Diff line number Diff line
@@ -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
                                   /* <trailers> */
                                   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;