httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s.@apache.org
Subject svn commit: r1135083 - in /httpd/httpd/trunk/modules: arch/netware/mod_netware.c arch/netware/mod_nw_ssl.c cache/cache_util.c http/http_filters.c proxy/proxy_util.c ssl/ssl_engine_io.c
Date Mon, 13 Jun 2011 10:58:11 GMT
Author: sf
Date: Mon Jun 13 10:58:10 2011
New Revision: 1135083

URL: http://svn.apache.org/viewvc?rev=1135083&view=rev
Log:
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

Modified:
    httpd/httpd/trunk/modules/arch/netware/mod_netware.c
    httpd/httpd/trunk/modules/arch/netware/mod_nw_ssl.c
    httpd/httpd/trunk/modules/cache/cache_util.c
    httpd/httpd/trunk/modules/http/http_filters.c
    httpd/httpd/trunk/modules/proxy/proxy_util.c
    httpd/httpd/trunk/modules/ssl/ssl_engine_io.c

Modified: httpd/httpd/trunk/modules/arch/netware/mod_netware.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/arch/netware/mod_netware.c?rev=1135083&r1=1135082&r2=1135083&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/arch/netware/mod_netware.c (original)
+++ httpd/httpd/trunk/modules/arch/netware/mod_netware.c Mon Jun 13 10:58:10 2011
@@ -51,7 +51,7 @@ static void *create_netware_dir_config(a
     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;
 }

Modified: httpd/httpd/trunk/modules/arch/netware/mod_nw_ssl.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/arch/netware/mod_nw_ssl.c?rev=1135083&r1=1135082&r2=1135083&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/arch/netware/mod_nw_ssl.c (original)
+++ httpd/httpd/trunk/modules/arch/netware/mod_nw_ssl.c Mon Jun 13 10:58:10 2011
@@ -895,7 +895,7 @@ static int nwssl_hook_Fixup(request_rec 
     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_por
 
 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;
 }

Modified: httpd/httpd/trunk/modules/cache/cache_util.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/cache/cache_util.c?rev=1135083&r1=1135082&r2=1135083&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/cache/cache_util.c (original)
+++ httpd/httpd/trunk/modules/cache/cache_util.c Mon Jun 13 10:58:10 2011
@@ -644,8 +644,8 @@ int cache_check_freshness(cache_handle_t
             /* 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",
-                                "110 Response is stale");
+                apr_table_mergen(h->resp_hdrs, "Warning",
+                                 "110 Response is stale");
             }
         }
 
@@ -663,8 +663,8 @@ int cache_check_freshness(cache_handle_t
              */
             if ((warn_head == NULL) ||
                 ((warn_head != NULL) && (ap_strstr_c(warn_head, "113") == NULL)))
{
-                apr_table_merge(h->resp_hdrs, "Warning",
-                                "113 Heuristic expiration");
+                apr_table_mergen(h->resp_hdrs, "Warning",
+                                 "113 Heuristic expiration");
             }
         }
         return 1;    /* Cache object is fresh (enough) */
@@ -720,8 +720,8 @@ int cache_check_freshness(cache_handle_t
         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",
-                        "110 Response is stale");
+            apr_table_mergen(h->resp_hdrs, "Warning",
+                             "110 Response is stale");
         }
 
         return 1;

Modified: httpd/httpd/trunk/modules/http/http_filters.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http/http_filters.c?rev=1135083&r1=1135082&r2=1135083&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http/http_filters.c (original)
+++ httpd/httpd/trunk/modules/http/http_filters.c Mon Jun 13 10:58:10 2011
@@ -1211,7 +1211,7 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_
     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);

Modified: httpd/httpd/trunk/modules/proxy/proxy_util.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/proxy_util.c?rev=1135083&r1=1135082&r2=1135083&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/proxy_util.c (original)
+++ httpd/httpd/trunk/modules/proxy/proxy_util.c Mon Jun 13 10:58:10 2011
@@ -2008,7 +2008,7 @@ PROXY_DECLARE(int) ap_proxy_pre_request(
                  * 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(
                  * 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");
             }
         }
     }

Modified: httpd/httpd/trunk/modules/ssl/ssl_engine_io.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/ssl/ssl_engine_io.c?rev=1135083&r1=1135082&r2=1135083&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/ssl/ssl_engine_io.c (original)
+++ httpd/httpd/trunk/modules/ssl/ssl_engine_io.c Mon Jun 13 10:58:10 2011
@@ -1053,7 +1053,7 @@ static apr_status_t ssl_io_filter_handsh
             ssl_log_ssl_error(SSLLOG_MARK, APLOG_INFO, server);
             /* ensure that the SSL structures etc are freed, etc: */
             ssl_filter_io_shutdown(filter_ctx, c, 1);
-            apr_table_set(c->notes, "SSL_connect_rv", "err");
+            apr_table_setn(c->notes, "SSL_connect_rv", "err");
             return MODSSL_ERROR_BAD_GATEWAY;
         }
 
@@ -1071,7 +1071,7 @@ static apr_status_t ssl_io_filter_handsh
                 }
                 /* ensure that the SSL structures etc are freed, etc: */
                 ssl_filter_io_shutdown(filter_ctx, c, 1);
-                apr_table_set(c->notes, "SSL_connect_rv", "err");
+                apr_table_setn(c->notes, "SSL_connect_rv", "err");
                 return HTTP_BAD_GATEWAY;
             }
             X509_free(cert);
@@ -1091,12 +1091,12 @@ static apr_status_t ssl_io_filter_handsh
                               hostname, hostname_note);
                 /* ensure that the SSL structures etc are freed, etc: */
                 ssl_filter_io_shutdown(filter_ctx, c, 1);
-                apr_table_set(c->notes, "SSL_connect_rv", "err");
+                apr_table_setn(c->notes, "SSL_connect_rv", "err");
                 return HTTP_BAD_GATEWAY;
             }
         }
 
-        apr_table_set(c->notes, "SSL_connect_rv", "ok");
+        apr_table_setn(c->notes, "SSL_connect_rv", "ok");
         return APR_SUCCESS;
     }
 



Mime
View raw message