httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r601514 - /httpd/mod_ftp/trunk/modules/ftp/mod_ftp.c
Date Wed, 05 Dec 2007 20:45:14 GMT
Author: wrowe
Date: Wed Dec  5 12:45:14 2007
New Revision: 601514

URL: http://svn.apache.org/viewvc?rev=601514&view=rev
Log:
According to mod_ftp.xml, LimitDBFile is global, while the
specific Limit directives are permitted per-vhost.  Drop the
invalid context checks for those related directives, and
greatly simplify the global LimitDBFile logic and save a ton
of cycles at startup.

Modified:
    httpd/mod_ftp/trunk/modules/ftp/mod_ftp.c

Modified: httpd/mod_ftp/trunk/modules/ftp/mod_ftp.c
URL: http://svn.apache.org/viewvc/httpd/mod_ftp/trunk/modules/ftp/mod_ftp.c?rev=601514&r1=601513&r2=601514&view=diff
==============================================================================
--- httpd/mod_ftp/trunk/modules/ftp/mod_ftp.c (original)
+++ httpd/mod_ftp/trunk/modules/ftp/mod_ftp.c Wed Dec  5 12:45:14 2007
@@ -78,11 +78,17 @@
                            apr_pool_t *ptemp, server_rec *s)
 {
     server_rec *base = s;
+    char *global_limitdbfile;
 
     ap_add_version_component(p, FTP_SERVER_STRING);
 
-    /* Fixup base server and virtual host default values
+    /* Fixup global values, then base server and virtual host values
      */
+    ftp_server_config *fsc = ftp_get_module_config(s->module_config);
+    if (!fsc->limitdbfile)
+        fsc->limitdbfile = ap_server_root_relative(p, FTP_DEFAULT_DBFILE);
+    global_limitdbfile = fsc->limitdbfile;
+
     for (; s; s = s->next) {
         ftp_server_config *fsc = ftp_get_module_config(s->module_config);
 
@@ -114,8 +120,7 @@
         if (fsc->limit_perserver == FTP_UNSPEC)
             fsc->limit_perserver = 0;
 
-        fsc->limitdbfile = ap_server_root_relative(p, fsc->limitdbfile);
-
+        fsc->limitdbfile = global_limitdbfile;
     }
 
     if (ftp_mutexdb_init(base, p) != APR_SUCCESS) {
@@ -155,7 +160,6 @@
     fsc->limit_perip        = FTP_UNSPEC;
     fsc->limit_perserver    = FTP_UNSPEC;
 
-    fsc->limitdbfile        = FTP_DEFAULT_DBFILE;
     return fsc;
 }
 
@@ -203,8 +207,6 @@
     if (fsc->limit_perserver == FTP_UNSPEC)
         fsc->limit_perserver = base->limit_perserver;
 
-    fsc->limitdbfile = ap_server_root_relative(p, base->limitdbfile);
-
     if (!fsc->banner_message) {
         fsc->banner_message = base->banner_message;
         fsc->banner_message_isfile = base->banner_message_isfile;
@@ -752,11 +754,6 @@
     char *error_str = NULL;
     ftp_server_config *fsc;
 
-    const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
-    if (err != NULL) {
-        return err;
-    }
-
     fsc = ftp_get_module_config(cmd->server->module_config);
 
     /* XXX: better error handling */
@@ -777,11 +774,6 @@
     char *error_str = NULL;
     ftp_server_config *fsc;
 
-    const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
-    if (err != NULL) {
-        return err;
-    }
-
     fsc = ftp_get_module_config(cmd->server->module_config);
 
     /* XXX: better error handling */
@@ -801,11 +793,6 @@
 {
     char *error_str = NULL;
     ftp_server_config *fsc;
-
-    const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
-    if (err != NULL) {
-        return err;
-    }
 
     fsc = ftp_get_module_config(cmd->server->module_config);
 



Mime
View raw message