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
[ 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 ]
#include "mod_auth.h"
typedef struct anon_auth_user {
- char *user;
+ const char *user;
struct anon_auth_user *next;
} anon_auth_user;
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;
}
}
}
sec->bind_regex = regexp;
- sec->bind_subst = apr_pstrdup(cmd->pool, subst);
+ sec->bind_subst = subst;
return NULL;
}
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);
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 "
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,
continue;
}
else {
- apr_table_set(d->override_list, argv[i], "1");
+ apr_table_setn(d->override_list, argv[i], "1");
}
}
}