Skip to content

Commit

Permalink
config: Speed up graceful restarts by using pre-hashed command table.…
Browse files Browse the repository at this point in the history
… PR 64066.

        [Giovanni Bechis <giovanni paclan.it>, Jim Jagielski]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1872786 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
jimjag committed Jan 14, 2020
1 parent 6daa704 commit 7b406d6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
-*- coding: utf-8 -*-
Changes with Apache 2.5.1

*) config: Speed up graceful restarts by using pre-hashed command table. PR 64066.
[Giovanni Bechis <giovanni paclan.it>, Jim Jagielski]

*) mod_lua: Add r:headers_in_table, r:headers_out_table, r:err_headers_out_table,
r:notes_table, r:subprocess_env_table as read-only native table alternatives
that can be iterated over. [Eric Covener]
Expand Down
10 changes: 7 additions & 3 deletions server/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -1120,8 +1120,9 @@ static const char *ap_build_config_sub(apr_pool_t *p, apr_pool_t *temp_pool,
const char *args;
char *cmd_name;
ap_directive_t *newdir;
module *mod = ap_top_module;
const command_rec *cmd;
ap_mod_list *ml;
char *lname;

if (*l == '#' || *l == '\0')
return NULL;
Expand Down Expand Up @@ -1159,9 +1160,12 @@ static const char *ap_build_config_sub(apr_pool_t *p, apr_pool_t *temp_pool,
newdir->line_num = parms->config_file->line_number;
newdir->args = apr_pstrdup(p, args);

if ((cmd = ap_find_command_in_modules(cmd_name, &mod)) != NULL) {
lname = apr_pstrdup(temp_pool, cmd_name);
ap_str_tolower(lname);
ml = apr_hash_get(ap_config_hash, lname, APR_HASH_KEY_STRING);

if (ml && (cmd = ml->cmd) != NULL) {
newdir->directive = cmd->name;

if (cmd->req_override & EXEC_ON_READ) {
ap_directive_t *sub_tree = NULL;

Expand Down

0 comments on commit 7b406d6

Please sign in to comment.