]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Merge r1711553, r1713040, r1683881 from trunk:
authorJim Jagielski <jim@apache.org>
Wed, 18 Nov 2015 16:15:29 +0000 (16:15 +0000)
committerJim Jagielski <jim@apache.org>
Wed, 18 Nov 2015 16:15:29 +0000 (16:15 +0000)
Constify + save a few bytes in conf pool

Save a few bytes in conf pool when processing 'AllowOverrideList'.

The 'override_list' table is allocated from the cmd->pool, just as all strings from argv[].
So there is no need to duplicate them.

+ some minor style issues

Save a few bytes in conf pool
Submitted by: jailletc36
Reviewed/backported by: jim

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1715015 13f79535-47bb-0310-9956-ffa450edef68

STATUS
modules/aaa/mod_authn_anon.c
modules/aaa/mod_authnz_ldap.c
server/core.c

diff --git a/STATUS b/STATUS
index 6af0176b31194d25ed3b790b6491f3516f53e6c1..618d1f60061c036fa1f270441038aa3bad936f13 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -112,15 +112,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
 
-  *) synch 2.4.x with trunk
-        mod_authn_anon: Constify + save a few bytes in conf pool
-        core: Save a few bytes in conf pool when processing 'AllowOverrideList'
-        mod_authnz_ldap: Save a few bytes in conf pool
-     trunk patch: http://svn.apache.org/r1711553
-                  http://svn.apache.org/r1713040
-                  http://svn.apache.org/r1683881
-     2.4.x patch: trunk works
-     +1: jailletc36, icing, jim
 
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:
   [ New proposals should be added at the end of the list ]
index 21e0da8560c2ff7fddfb1cbb1b8d0aac0da22c8c..82559bcc75e4081ec45706ab1bfa7d4d9bc5453a 100644 (file)
@@ -57,7 +57,7 @@
 #include "mod_auth.h"
 
 typedef struct anon_auth_user {
-    char *user;
+    const char *user;
     struct anon_auth_user *next;
 } anon_auth_user;
 
@@ -103,7 +103,7 @@ static const char *anon_set_string_slots(cmd_parms *cmd,
         else {
             first = conf->users;
             conf->users = apr_palloc(cmd->pool, sizeof(*conf->users));
-            conf->users->user = apr_pstrdup(cmd->pool, arg);
+            conf->users->user = arg;
             conf->users->next = first;
         }
     }
index 211e4f74850d9e4e3839b483398bd200bb9cf5e8..370016f70970ee57432fac786dd5455066d6b5a1 100644 (file)
@@ -1627,7 +1627,7 @@ static const char *set_bind_pattern(cmd_parms *cmd, void *_cfg, const char *exp,
     }
 
     sec->bind_regex = regexp;
-    sec->bind_subst = apr_pstrdup(cmd->pool, subst);
+    sec->bind_subst = subst;
 
     return NULL;
 }
@@ -1655,7 +1655,7 @@ static const char *set_bind_password(cmd_parms *cmd, void *_cfg, const char *arg
         result = ap_get_exec_line(cmd->pool,
                                   (const char*)argv[0], (const char * const *)argv);
 
-        if(!result) {
+        if (!result) {
             return apr_pstrcat(cmd->pool,
                                "Unable to get bind password from exec of ",
                                arg+5, NULL);
index 803d4d4b6d810a55d3de5eb693ddb24319d8e3cc..a56aab4cdfcb45984fa28b8e716df36fb8b0d4c2 100644 (file)
@@ -1736,7 +1736,7 @@ static const char *set_override_list(cmd_parms *cmd, void *d_, int argc, char *c
 
     d->override_list = apr_table_make(cmd->pool, argc);
 
-    for (i=0;i<argc;i++){
+    for (i = 0; i < argc; i++) {
         if (!strcasecmp(argv[i], "None")) {
             if (argc != 1) {
                 return "'None' not allowed with other directives in "
@@ -1747,6 +1747,7 @@ static const char *set_override_list(cmd_parms *cmd, void *d_, int argc, char *c
         else {
             const command_rec *result = NULL;
             module *mod = ap_top_module;
+
             result = ap_find_command_in_modules(argv[i], &mod);
             if (result == NULL) {
                 ap_log_error(APLOG_MARK, APLOG_WARNING, 0, cmd->server,
@@ -1765,7 +1766,7 @@ static const char *set_override_list(cmd_parms *cmd, void *d_, int argc, char *c
                 continue;
             }
             else {
-                apr_table_set(d->override_list, argv[i], "1");
+                apr_table_setn(d->override_list, argv[i], "1");
             }
         }
     }