You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by iv...@apache.org on 2013/12/05 14:10:38 UTC
svn commit: r1548124 - /subversion/trunk/subversion/mod_dav_svn/mod_dav_svn.c
Author: ivan
Date: Thu Dec 5 13:10:38 2013
New Revision: 1548124
URL: http://svn.apache.org/r1548124
Log:
mod_dav_svn: Fix SVNCacheTextDeltas and SVNAdvertiseV2Protocol directives
merging.
* subversion/mod_dav_svn/mod_dav_svn.c
(create_dir_config): Initialize V2_PROTOCOL and TXDELTA_CACHE to
CONF_FLAG_DEFAULT.
(get_conf_flag): New helper to convert conf_flag enum to boolean.
(dav_svn__check_httpv2_support, dav_svn__get_txdelta_cache_flag): Use
get_conf_flag().
Modified:
subversion/trunk/subversion/mod_dav_svn/mod_dav_svn.c
Modified: subversion/trunk/subversion/mod_dav_svn/mod_dav_svn.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/mod_dav_svn/mod_dav_svn.c?rev=1548124&r1=1548123&r2=1548124&view=diff
==============================================================================
--- subversion/trunk/subversion/mod_dav_svn/mod_dav_svn.c (original)
+++ subversion/trunk/subversion/mod_dav_svn/mod_dav_svn.c Thu Dec 5 13:10:38 2013
@@ -215,9 +215,9 @@ create_dir_config(apr_pool_t *p, char *d
if (dir)
conf->root_dir = svn_urlpath__canonicalize(dir, p);
conf->bulk_updates = CONF_BULKUPD_DEFAULT;
- conf->v2_protocol = CONF_FLAG_ON;
+ conf->v2_protocol = CONF_FLAG_DEFAULT;
conf->hooks_env = NULL;
- conf->txdelta_cache = CONF_FLAG_ON;
+ conf->txdelta_cache = CONF_FLAG_DEFAULT;
return conf;
}
@@ -613,6 +613,16 @@ SVNHooksEnv_cmd(cmd_parms *cmd, void *co
return NULL;
}
+static svn_boolean_t
+get_conf_flag(enum conf_flag flag, svn_boolean_t default_value)
+{
+ if (flag == CONF_FLAG_ON)
+ return TRUE;
+ else if (flag == CONF_FLAG_OFF)
+ return FALSE;
+ else /* CONF_FLAG_DEFAULT*/
+ return default_value;
+}
/** Accessor functions for the module's configuration state **/
@@ -829,7 +839,7 @@ dav_svn__check_httpv2_support(request_re
svn_boolean_t available;
conf = ap_get_module_config(r->per_dir_config, &dav_svn_module);
- available = conf->v2_protocol == CONF_FLAG_ON;
+ available = get_conf_flag(conf->v2_protocol, TRUE);
/* If our configuration says that HTTPv2 is available, but we are
proxying requests to a master Subversion server which lacks
@@ -912,7 +922,9 @@ dav_svn__get_txdelta_cache_flag(request_
dir_conf_t *conf;
conf = ap_get_module_config(r->per_dir_config, &dav_svn_module);
- return conf->txdelta_cache == CONF_FLAG_ON;
+
+ /* txdelta caching is enabled by default. */
+ return get_conf_flag(conf->txdelta_cache, TRUE);
}