]> granicus.if.org Git - apache/commitdiff
Short-circuit out of mod_userdir's translation handler faster on
authorBrian Pane <brianp@apache.org>
Mon, 29 Apr 2002 07:45:43 +0000 (07:45 +0000)
committerBrian Pane <brianp@apache.org>
Mon, 29 Apr 2002 07:45:43 +0000 (07:45 +0000)
non "/~*" requests

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

modules/mappers/mod_userdir.c

index d8b36fdfb01e2f363da7ae302d0c9281b41a7ccf..0b035894a1e2d2e8b4aca2ec3e446857bb65a44e 100644 (file)
@@ -221,11 +221,10 @@ static const command_rec userdir_cmds[] = {
 
 static int translate_userdir(request_rec *r)
 {
-    ap_conf_vector_t *server_conf = r->server->module_config;
-    const userdir_config *s_cfg = ap_get_module_config(server_conf,
-                                                       &userdir_module);
+    ap_conf_vector_t *server_conf;
+    const userdir_config *s_cfg;
     char *name = r->uri;
-    const char *userdirs = s_cfg->userdir;
+    const char *userdirs;
     const char *w, *dname;
     char *redirect;
     char *x = NULL;
@@ -235,7 +234,13 @@ static int translate_userdir(request_rec *r)
      * If the URI doesn't match our basic pattern, we've nothing to do with
      * it.
      */
-    if (s_cfg->userdir == NULL || name[0] != '/' || name[1] != '~') {
+    if (name[0] != '/' || name[1] != '~') {
+        return DECLINED;
+    }
+    server_conf = r->server->module_config;
+    s_cfg = ap_get_module_config(server_conf, &userdir_module);
+    userdirs = s_cfg->userdir;
+    if (userdirs == NULL) {
         return DECLINED;
     }