Commit d714b4c4 authored by Ian Holsman's avatar Ian Holsman
Browse files

This patch changes the apr_table_elts macro so that it provides

access to the internals of an apr_table_t via a const pointer
instead of the current non-const pointer.


Submitted by:	Brian Pane <BPane@pacbell.net>
Reviewed by:	Ian Holsman


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91860 13f79535-47bb-0310-9956-ffa450edef68
parent 25e0f366
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -567,7 +567,7 @@ BOOL WINAPI GetServerVariable (HCONN hConn, LPSTR lpszVariableName,
        /* lf delimited, colon split, comma seperated and 
         * null terminated list of HTTP_ vars 
         */
        char **env = (char**) apr_table_elts(r->subprocess_env)->elts;
        const char * const *env = (const char* const *) apr_table_elts(r->subprocess_env)->elts;
        int nelts = 2 * apr_table_elts(r->subprocess_env)->nelts;
        int i;

@@ -601,7 +601,7 @@ BOOL WINAPI GetServerVariable (HCONN hConn, LPSTR lpszVariableName,
        /* lf delimited, colon split, comma seperated and 
         * null terminated list of the raw request header
         */
        char **raw = (char**) apr_table_elts(r->headers_in)->elts;
        const char * const *raw = (const char* const *) apr_table_elts(r->headers_in)->elts;
        int nelts = 2 * apr_table_elts(r->headers_in)->nelts;
        int i;

+6 −6
Original line number Diff line number Diff line
@@ -1216,8 +1216,8 @@ static dav_error *dav_gen_supported_methods(request_rec *r,
                                            const apr_table_t *methods,
                                            ap_text_header *body)
{
    apr_array_header_t *arr;
    apr_table_entry_t *elts;
    const apr_array_header_t *arr;
    const apr_table_entry_t *elts;
    ap_xml_elem *child;
    ap_xml_attr *attr;
    char *s;
@@ -1228,7 +1228,7 @@ static dav_error *dav_gen_supported_methods(request_rec *r,
    if (elem->first_child == NULL) {
        /* show all supported methods */
        arr = apr_table_elts(methods);
        elts = (apr_table_entry_t *) arr->elts;
        elts = (const apr_table_entry_t *) arr->elts;

        for (i = 0; i < arr->nelts; ++i) {
            if (elts[i].key == NULL)
@@ -1459,8 +1459,8 @@ static int dav_method_options(request_rec *r)
    const char *dav_level;
    char *allow;
    char *s;
    apr_array_header_t *arr;
    apr_table_entry_t *elts;
    const apr_array_header_t *arr;
    const apr_table_entry_t *elts;
    apr_table_t *methods = apr_table_make(r->pool, 12);
    ap_text_header vsn_options = { 0 };
    ap_text_header body = { 0 };
@@ -1641,7 +1641,7 @@ static int dav_method_options(request_rec *r)

    /* Generate the Allow header */
    arr = apr_table_elts(methods);
    elts = (apr_table_entry_t *) arr->elts;
    elts = (const apr_table_entry_t *) arr->elts;
    text_size = 0;

    /* first, compute total length */
+2 −2
Original line number Diff line number Diff line
@@ -2609,8 +2609,8 @@ static int handle_printenv(include_ctx_t *ctx, apr_bucket_brigade **bb,
    if (ctx->flags & FLAG_PRINTING) {
        ap_ssi_get_tag_and_value(ctx, &tag, &tag_val, 1);
        if ((tag == NULL) && (tag_val == NULL)) {
            apr_array_header_t *arr = apr_table_elts(r->subprocess_env);
            apr_table_entry_t *elts = (apr_table_entry_t *)arr->elts;
            const apr_array_header_t *arr = apr_table_elts(r->subprocess_env);
            const apr_table_entry_t *elts = (const apr_table_entry_t *)arr->elts;
            int i;
            const char *key_text, *val_text;
            apr_size_t   k_len, v_len, t_wrt;
+3 −3
Original line number Diff line number Diff line
@@ -257,8 +257,8 @@ static int log_script(request_rec *r, cgi_server_conf * conf, int ret,
		  char *dbuf, const char *sbuf, apr_file_t *script_in, 
                  apr_file_t *script_err)
{
    apr_array_header_t *hdrs_arr = apr_table_elts(r->headers_in);
    apr_table_entry_t *hdrs = (apr_table_entry_t *) hdrs_arr->elts;
    const apr_array_header_t *hdrs_arr = apr_table_elts(r->headers_in);
    const apr_table_entry_t *hdrs = (const apr_table_entry_t *) hdrs_arr->elts;
    char argsbuffer[HUGE_STRING_LEN];
    apr_file_t *f = NULL;
    int i;
@@ -300,7 +300,7 @@ static int log_script(request_rec *r, cgi_server_conf * conf, int ret,

    apr_file_puts("%response\n", f);
    hdrs_arr = apr_table_elts(r->err_headers_out);
    hdrs = (apr_table_entry_t *) hdrs_arr->elts;
    hdrs = (const apr_table_entry_t *) hdrs_arr->elts;

    for (i = 0; i < hdrs_arr->nelts; ++i) {
	if (!hdrs[i].key)
+3 −3
Original line number Diff line number Diff line
@@ -749,8 +749,8 @@ static int log_scripterror(request_rec *r, cgid_server_conf * conf, int ret,
static int log_script(request_rec *r, cgid_server_conf * conf, int ret, 
                  char *dbuf, const char *sbuf, apr_file_t *script_in, apr_file_t *script_err) 
{ 
    apr_array_header_t *hdrs_arr = apr_table_elts(r->headers_in); 
    apr_table_entry_t *hdrs = (apr_table_entry_t *) hdrs_arr->elts; 
    const apr_array_header_t *hdrs_arr = apr_table_elts(r->headers_in); 
    const apr_table_entry_t *hdrs = (apr_table_entry_t *) hdrs_arr->elts; 
    char argsbuffer[HUGE_STRING_LEN]; 
    apr_file_t *f = NULL; 
    int i; 
@@ -795,7 +795,7 @@ static int log_script(request_rec *r, cgid_server_conf * conf, int ret,

    apr_file_puts("%response\n", f); 
    hdrs_arr = apr_table_elts(r->err_headers_out); 
    hdrs = (apr_table_entry_t *) hdrs_arr->elts; 
    hdrs = (const apr_table_entry_t *) hdrs_arr->elts; 

    for (i = 0; i < hdrs_arr->nelts; ++i) { 
        if (!hdrs[i].key) 
Loading