Commit 414b5feb authored by Stefan Fritsch's avatar Stefan Fritsch
Browse files

Avoid some memory allocations by using apr_table_setn where the string

arguments are const.

Submitted by: Christophe JAILLET <christophe jaillet wanadoo fr>
PR: 51357


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1135083 13f79535-47bb-0310-9956-ffa450edef68
parent 8f0e8a82
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -51,7 +51,7 @@ static void *create_netware_dir_config(apr_pool_t *p, char *dir)
    new->file_handler_mode = apr_table_make(p, 10);
    new->extra_env_vars = apr_table_make(p, 10);

    apr_table_set(new->file_type_handlers, "NLM", "OS");
    apr_table_setn(new->file_type_handlers, "NLM", "OS");

    return new;
}
+2 −2
Original line number Diff line number Diff line
@@ -895,7 +895,7 @@ static int nwssl_hook_Fixup(request_rec *r)
    if (!isSecure(r) && !isSecureUpgraded(r))
        return DECLINED;

    apr_table_set(r->subprocess_env, "HTTPS", "on");
    apr_table_setn(r->subprocess_env, "HTTPS", "on");

    return DECLINED;
}
@@ -918,7 +918,7 @@ static apr_port_t nwssl_hook_default_port(const request_rec *r)

int ssl_proxy_enable(conn_rec *c)
{
    apr_table_set(c->notes, "nwconv-ssl", "Y");
    apr_table_setn(c->notes, "nwconv-ssl", "Y");

    return 1;
}
+6 −6
Original line number Diff line number Diff line
@@ -644,7 +644,7 @@ int cache_check_freshness(cache_handle_t *h, cache_request_rec *cache,
            /* make sure we don't stomp on a previous warning */
            if ((warn_head == NULL) ||
                ((warn_head != NULL) && (ap_strstr_c(warn_head, "110") == NULL))) {
                apr_table_merge(h->resp_hdrs, "Warning",
                apr_table_mergen(h->resp_hdrs, "Warning",
                                 "110 Response is stale");
            }
        }
@@ -663,7 +663,7 @@ int cache_check_freshness(cache_handle_t *h, cache_request_rec *cache,
             */
            if ((warn_head == NULL) ||
                ((warn_head != NULL) && (ap_strstr_c(warn_head, "113") == NULL))) {
                apr_table_merge(h->resp_hdrs, "Warning",
                apr_table_mergen(h->resp_hdrs, "Warning",
                                 "113 Heuristic expiration");
            }
        }
@@ -720,7 +720,7 @@ int cache_check_freshness(cache_handle_t *h, cache_request_rec *cache,
        warn_head = apr_table_get(h->resp_hdrs, "Warning");
        if ((warn_head == NULL) ||
            ((warn_head != NULL) && (ap_strstr_c(warn_head, "110") == NULL))) {
            apr_table_merge(h->resp_hdrs, "Warning",
            apr_table_mergen(h->resp_hdrs, "Warning",
                             "110 Response is stale");
        }

+1 −1
Original line number Diff line number Diff line
@@ -1211,7 +1211,7 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_http_header_filter(ap_filter_t *f,
    if (apr_table_get(r->subprocess_env, "force-no-vary") != NULL) {
        apr_table_unset(r->headers_out, "Vary");
        r->proto_num = HTTP_VERSION(1,0);
        apr_table_set(r->subprocess_env, "force-response-1.0", "1");
        apr_table_setn(r->subprocess_env, "force-response-1.0", "1");
    }
    else {
        fixup_vary(r);
+2 −2
Original line number Diff line number Diff line
@@ -2008,7 +2008,7 @@ PROXY_DECLARE(int) ap_proxy_pre_request(proxy_worker **worker,
                 * ensure that mod_proxy_http does the correct thing
                 * regarding the Connection header in the request.
                 */
                apr_table_set(r->subprocess_env, "proxy-nokeepalive", "1");
                apr_table_setn(r->subprocess_env, "proxy-nokeepalive", "1");
            }
        }
        else if (r->proxyreq == PROXYREQ_REVERSE) {
@@ -2024,7 +2024,7 @@ PROXY_DECLARE(int) ap_proxy_pre_request(proxy_worker **worker,
                 * ensure that mod_proxy_http does the correct thing
                 * regarding the Connection header in the request.
                 */
                apr_table_set(r->subprocess_env, "proxy-nokeepalive", "1");
                apr_table_setn(r->subprocess_env, "proxy-nokeepalive", "1");
            }
        }
    }
Loading