* mod_dav_fs: set default value of DavLockDB using installation layout
authorJan Kaluža <jkaluza@apache.org>
Fri, 17 Apr 2015 07:28:50 +0000 (07:28 +0000)
committerJan Kaluža <jkaluza@apache.org>
Fri, 17 Apr 2015 07:28:50 +0000 (07:28 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1674222 13f79535-47bb-0310-9956-ffa450edef68

acinclude.m4
build/mkconfNW.awk
include/ap_config_layout.h.in
modules/dav/fs/mod_dav_fs.c

index e2f8c22e575c741ec8f3ce53336bd58456534289..dfcb3c9b0368e972dbdfa2cfe5a35f1e9f00c864 100644 (file)
@@ -43,6 +43,7 @@ AC_DEFUN(APACHE_GEN_CONFIG_VARS,[
   APACHE_SUBST(installbuilddir)
   APACHE_SUBST(runtimedir)
   APACHE_SUBST(proxycachedir)
+  APACHE_SUBST(davlockdb)
   APACHE_SUBST(other_targets)
   APACHE_SUBST(progname)
   APACHE_SUBST(prefix)
@@ -710,6 +711,7 @@ AC_DEFUN(APACHE_EXPORT_ARGUMENTS,[
   APACHE_SUBST_EXPANDED_ARG(runtimedir)
   APACHE_SUBST_EXPANDED_ARG(logfiledir)
   APACHE_SUBST_EXPANDED_ARG(proxycachedir)
+  APACHE_SUBST_EXPANDED_ARG(davlockdb)
 ])
 
 dnl 
index c0028cef0c7c42581c26648241ff183216b9b86d..40ef183c106efe0e745e729b374dabbe8a979af9 100644 (file)
@@ -26,12 +26,14 @@ BEGIN {
     A["runtimedir"] = "logs"
     A["errordir"] = "error"
     A["proxycachedir"] = "proxy"
+    A["davlockdb"] = "davlockdb"
 
     B["htdocsdir"] = A["ServerRoot"]"/"A["htdocsdir"]
     B["iconsdir"] = A["ServerRoot"]"/"A["iconsdir"]
     B["manualdir"] = A["ServerRoot"]"/"A["manualdir"]
     B["errordir"] = A["ServerRoot"]"/"A["errordir"]
     B["proxycachedir"] = A["ServerRoot"]"/"A["proxycachedir"]
+    B["davlockdb"] = A["ServerRoot"]"/"A["davlockdb"]
     B["cgidir"] = A["ServerRoot"]"/"A["cgidir"]
     B["logfiledir"] = A["logfiledir"]
     B["sysconfdir"] = A["sysconfdir"]
index 2b4a70c46168f483f1a2da1f72a23d4cda192ac6..cda6a1130e6c6b70e23136d5ad6aceeaa1316e90 100644 (file)
@@ -60,5 +60,7 @@
 #define DEFAULT_REL_LOGFILEDIR "@rel_logfiledir@"
 #define DEFAULT_EXP_PROXYCACHEDIR "@exp_proxycachedir@"
 #define DEFAULT_REL_PROXYCACHEDIR "@rel_proxycachedir@"
+#define DEFAULT_EXP_DAVLOCKDB "@exp_davlockdb@"
+#define DEFAULT_REL_DAVLOCKDB "@rel_davlockdb@"
 
 #endif /* AP_CONFIG_LAYOUT_H */
index addfd7e93f2111a9b34834d782e25d92609cb047..78039c9b989fd0156e45869261b99d12af63338c 100644 (file)
@@ -17,6 +17,7 @@
 #include "httpd.h"
 #include "http_config.h"
 #include "apr_strings.h"
+#include "ap_config_auto.h"
 
 #include "mod_dav.h"
 #include "repos.h"
@@ -39,7 +40,15 @@ const char *dav_get_lockdb_path(const request_rec *r)
 
 static void *dav_fs_create_server_config(apr_pool_t *p, server_rec *s)
 {
-    return apr_pcalloc(p, sizeof(dav_fs_server_conf));
+    dav_fs_server_conf *conf = apr_pcalloc(p, sizeof(dav_fs_server_conf));
+#ifdef DEFAULT_EXP_DAVLOCKDB
+    conf->lockdb_path = DEFAULT_EXP_DAVLOCKDB;
+    if (*conf->lockdb_path == '\0') {
+        conf->lockdb_path = NULL;
+    }
+#endif
+
+    return conf;
 }
 
 static void *dav_fs_merge_server_config(apr_pool_t *p,