]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Provide the same optimization to the dir_config structure to track
authorWilliam A. Rowe Jr <wrowe@apache.org>
Mon, 30 Jul 2001 18:51:57 +0000 (18:51 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Mon, 30 Jul 2001 18:51:57 +0000 (18:51 +0000)
  d_is_absolute, along with d_is_fnmatch.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89791 13f79535-47bb-0310-9956-ffa450edef68

include/http_core.h
server/core.c

index 112c4e5822dbd9f6b3bd20cabbdd8f396e091c8a..4e0d2ecfd6bcb63b88e7c39498c839ddc82aad39 100644 (file)
@@ -364,7 +364,7 @@ typedef enum {
 } server_signature_e;
 
 typedef struct {
-    /* path of the directory/regex/etc.  see also d_is_fnmatch below */
+    /* path of the directory/regex/etc. see also d_is_fnmatch/absolute below */
     char *d;
     /* the number of slashes in d */
     unsigned d_components;
@@ -426,6 +426,12 @@ typedef struct {
      */
     unsigned d_is_fnmatch : 1;
 
+    /* since is_absolute(conf->d) was being called so frequently in
+     * directory_walk() and its relatives, this field was created and
+     * is set to the result of that call.
+     */
+    unsigned d_is_absolute : 1;
+
     /* should we force a charset on any outgoing parameterless content-type?
      * if so, which charset?
      */
index ff74687bff9a5a56602817e7cb60f34b44d8ed14..9aab72d17ae086ec53f834231643d660013fa8bc 100644 (file)
@@ -132,6 +132,7 @@ static void *create_core_dir_config(apr_pool_t *a, char *dir)
         conf->d = apr_pstrcat(a, dir, "/", NULL);
     }
     conf->d_is_fnmatch = conf->d ? (apr_is_fnmatch(conf->d) != 0) : 0;
+    conf->d_is_absolute = conf->d ? (ap_os_is_path_absolute(conf->d) != 0) : 0;
     conf->d_components = conf->d ? ap_count_dirs(conf->d) : 0;
 
     conf->opts = dir ? OPT_UNSET : OPT_UNSET|OPT_ALL;
@@ -192,6 +193,7 @@ static void *merge_core_dir_configs(apr_pool_t *a, void *basev, void *newv)
     
     conf->d = new->d;
     conf->d_is_fnmatch = new->d_is_fnmatch;
+    conf->d_is_absolute = new->d_is_absolute;
     conf->d_components = new->d_components;
     conf->r = new->r;
     
@@ -1663,6 +1665,7 @@ static const char *urlsection(cmd_parms *cmd, void *mconfig, const char *arg)
 
     conf->d = apr_pstrdup(cmd->pool, cmd->path);       /* No mangling, please */
     conf->d_is_fnmatch = apr_is_fnmatch(conf->d) != 0;
+    conf->d_is_absolute = ap_os_is_path_absolute(conf->d) != 0;
     conf->r = r;
 
     ap_add_per_url_conf(cmd->server, new_url_conf);
@@ -1729,6 +1732,7 @@ static const char *filesection(cmd_parms *cmd, void *mconfig, const char *arg)
 
     conf->d = cmd->path;
     conf->d_is_fnmatch = apr_is_fnmatch(conf->d) != 0;
+    conf->d_is_absolute = ap_os_is_path_absolute(conf->d) != 0;
     conf->r = r;
 
     ap_add_file_conf(c, new_file_conf);