httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s.@apache.org
Subject svn commit: r1135084 - in /httpd/httpd/trunk/modules: aaa/mod_auth_form.c dav/main/mod_dav.c mappers/mod_rewrite.c proxy/mod_proxy.c proxy/mod_proxy_ftp.c ssl/ssl_engine_kernel.c
Date Mon, 13 Jun 2011 11:04:29 GMT
Author: sf
Date: Mon Jun 13 11:04:29 2011
New Revision: 1135084

URL: http://svn.apache.org/viewvc?rev=1135084&view=rev
Log:
Avoid some memory allocations by using apr_table_setn where the string arguments
are allocated from the request pool and not modified later on.

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

Modified:
    httpd/httpd/trunk/modules/aaa/mod_auth_form.c
    httpd/httpd/trunk/modules/dav/main/mod_dav.c
    httpd/httpd/trunk/modules/mappers/mod_rewrite.c
    httpd/httpd/trunk/modules/proxy/mod_proxy.c
    httpd/httpd/trunk/modules/proxy/mod_proxy_ftp.c
    httpd/httpd/trunk/modules/ssl/ssl_engine_kernel.c

Modified: httpd/httpd/trunk/modules/aaa/mod_auth_form.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/aaa/mod_auth_form.c?rev=1135084&r1=1135083&r2=1135084&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/aaa/mod_auth_form.c (original)
+++ httpd/httpd/trunk/modules/aaa/mod_auth_form.c Mon Jun 13 11:04:29 2011
@@ -832,8 +832,8 @@ static void fake_basic_authentication(re
         char *base64 = apr_palloc(r->pool,
                                   apr_base64_encode_len(size + 1) * sizeof(char));
         apr_base64_encode(base64, basic, size);
-        apr_table_set(r->headers_in, "Authorization",
-                      apr_pstrcat(r->pool, "Basic ", base64, NULL));
+        apr_table_setn(r->headers_in, "Authorization",
+                       apr_pstrcat(r->pool, "Basic ", base64, NULL));
     }
 }
 

Modified: httpd/httpd/trunk/modules/dav/main/mod_dav.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/dav/main/mod_dav.c?rev=1135084&r1=1135083&r2=1135084&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/dav/main/mod_dav.c (original)
+++ httpd/httpd/trunk/modules/dav/main/mod_dav.c Mon Jun 13 11:04:29 2011
@@ -2667,8 +2667,8 @@ static int dav_method_copymove(request_r
         if (lookup.rnew->status == HTTP_UNAUTHORIZED && auth != NULL) {
             /* propagate the WWW-Authorization header up from the
              * subreq so the client sees it. */
-            apr_table_set(r->err_headers_out, "WWW-Authenticate",
-                          apr_pstrdup(r->pool, auth));
+            apr_table_setn(r->err_headers_out, "WWW-Authenticate",
+                           apr_pstrdup(r->pool, auth));
         }
 
         /* ### how best to report this... */
@@ -3148,7 +3148,7 @@ static int dav_method_lock(request_rec *
                                         lock->locktoken),
                                     ">", NULL);
 
-        apr_table_set(r->headers_out, "Lock-Token", locktoken_txt);
+        apr_table_setn(r->headers_out, "Lock-Token", locktoken_txt);
     }
 
     (*locks_hooks->close_lockdb)(lockdb);

Modified: httpd/httpd/trunk/modules/mappers/mod_rewrite.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/mappers/mod_rewrite.c?rev=1135084&r1=1135083&r2=1135084&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/mappers/mod_rewrite.c (original)
+++ httpd/httpd/trunk/modules/mappers/mod_rewrite.c Mon Jun 13 11:04:29 2011
@@ -4482,8 +4482,8 @@ static int hook_uri2file(request_rec *r)
          *  now apply the rules ...
          */
         rulestatus = apply_rewrite_list(r, conf->rewriterules, NULL);
-        apr_table_set(r->notes,"mod_rewrite_rewritten",
-                      apr_psprintf(r->pool,"%d",rulestatus));
+        apr_table_setn(r->notes, "mod_rewrite_rewritten",
+                       apr_psprintf(r->pool,"%d",rulestatus));
     }
     else {
         rewritelog((r, 2, NULL, "uri already rewritten. Status %s, Uri %s, "

Modified: httpd/httpd/trunk/modules/proxy/mod_proxy.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy.c?rev=1135084&r1=1135083&r2=1135084&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy.c (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy.c Mon Jun 13 11:04:29 2011
@@ -880,8 +880,8 @@ static int proxy_handler(request_rec *r)
         maxfwd = conf->maxfwd;
     }
     if (maxfwd >= 0) {
-        apr_table_set(r->headers_in, "Max-Forwards",
-                      apr_psprintf(r->pool, "%ld", maxfwd));
+        apr_table_setn(r->headers_in, "Max-Forwards",
+                       apr_psprintf(r->pool, "%ld", maxfwd));
     }
 
     if (r->method_number == M_TRACE) {

Modified: httpd/httpd/trunk/modules/proxy/mod_proxy_ftp.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy_ftp.c?rev=1135084&r1=1135083&r2=1135084&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy_ftp.c (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy_ftp.c Mon Jun 13 11:04:29 2011
@@ -1165,8 +1165,8 @@ static int proxy_ftp_handler(request_rec
                 break;
         if (*secs_str != '\0') {
             secs = atol(secs_str);
-            apr_table_add(r->headers_out, "Retry-After",
-                          apr_psprintf(p, "%lu", (unsigned long)(60 * secs)));
+            apr_table_addn(r->headers_out, "Retry-After",
+                           apr_psprintf(p, "%lu", (unsigned long)(60 * secs)));
         }
         return ftp_proxyerror(r, backend, HTTP_SERVICE_UNAVAILABLE, ftpmessage);
     }

Modified: httpd/httpd/trunk/modules/ssl/ssl_engine_kernel.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/ssl/ssl_engine_kernel.c?rev=1135084&r1=1135083&r2=1135084&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/ssl/ssl_engine_kernel.c (original)
+++ httpd/httpd/trunk/modules/ssl/ssl_engine_kernel.c Mon Jun 13 11:04:29 2011
@@ -1042,7 +1042,7 @@ int ssl_hook_UserCheck(request_rec *r)
                                              apr_pstrcat(r->pool, clientdn,
                                                          ":password", NULL)),
                             NULL);
-    apr_table_set(r->headers_in, "Authorization", auth_line);
+    apr_table_setn(r->headers_in, "Authorization", auth_line);
 
     ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r,
                   "Faking HTTP Basic Auth header: \"Authorization: %s\"",



Mime
View raw message