Author: lgo
Date: Wed Dec 5 20:46:33 2012
New Revision: 1417639
URL: http://svn.apache.org/viewvc?rev=1417639&view=rev
Log:
Add a Force option to SVNAllowBulkUpdates. This allows a server admin to always
respond to an update-report request with all content and properties inline.
Now that skelta mode will be the new default with ra_serf, this feature can be
useful in certain situations where the admin wants to avoid the overhead
of per-file GET requests (e.g. with per-request Kerberos authentication).
* subversion/mod_dav_svn/dav_svn.h
(dav_svn__bulk_upd_conf): New enum.
(struct dav_svn_repos): Change type of bulk_updates member.
(dav_svn__get_bulk_updates_flag): Change type of return value.
* subversion/mod_dav_svn/mod_dav_svn.c
(struct dir_conf_t): Change type of bulk_updates member.
(create_dir_config): Use new enum values.
(SVNAllowBulkUpdates_cmd): Parse the new Force option.
(dav_svn__get_bulk_updates_flag): Change type of return value.
(command_rec cmds[]): Update the definition of SVNAllowBulkUpdates.
* subversion/mod_dav_svn/reports/update.c
(dav_svn__update_report): If the Force flag is set, set the send_all flag,
even if the client requested skelta mode!
Modified:
subversion/trunk/subversion/mod_dav_svn/dav_svn.h
subversion/trunk/subversion/mod_dav_svn/mod_dav_svn.c
subversion/trunk/subversion/mod_dav_svn/reports/update.c
Modified: subversion/trunk/subversion/mod_dav_svn/dav_svn.h
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/mod_dav_svn/dav_svn.h?rev=1417639&r1=1417638&r2=1417639&view=diff
==============================================================================
--- subversion/trunk/subversion/mod_dav_svn/dav_svn.h (original)
+++ subversion/trunk/subversion/mod_dav_svn/dav_svn.h Wed Dec 5 20:46:33 2012
@@ -52,6 +52,12 @@ extern "C" {
/* a pool-key for the shared dav_svn_root used by autoversioning */
#define DAV_SVN__AUTOVERSIONING_ACTIVITY "svn-autoversioning-activity"
+/* Option values for SVNAllowBulkUpdates */
+typedef enum dav_svn__bulk_upd_conf {
+ CONF_BULKUPD_ON,
+ CONF_BULKUPD_OFF,
+ CONF_BULKUPD_FORCE
+} dav_svn__bulk_upd_conf;
/* dav_svn_repos
*
@@ -110,7 +116,7 @@ typedef struct dav_svn_repos {
svn_boolean_t autoversioning;
/* Whether bulk updates are allowed for this repository. */
- svn_boolean_t bulk_updates;
+ dav_svn__bulk_upd_conf bulk_updates;
/* Whether HTTP protocol version 2 is allowed to be used. */
svn_boolean_t v2_protocol;
@@ -302,7 +308,7 @@ const char *dav_svn__get_fs_parent_path(
svn_boolean_t dav_svn__get_autoversioning_flag(request_rec *r);
/* for the repository referred to by this request, are bulk updates allowed? */
-svn_boolean_t dav_svn__get_bulk_updates_flag(request_rec *r);
+dav_svn__bulk_upd_conf dav_svn__get_bulk_updates_flag(request_rec *r);
/* for the repository referred to by this request, are subrequests active? */
svn_boolean_t dav_svn__get_pathauthz_flag(request_rec *r);
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=1417639&r1=1417638&r2=1417639&view=diff
==============================================================================
--- subversion/trunk/subversion/mod_dav_svn/mod_dav_svn.c (original)
+++ subversion/trunk/subversion/mod_dav_svn/mod_dav_svn.c Wed Dec 5 20:46:33
2012
@@ -93,7 +93,7 @@ typedef struct dir_conf_t {
const char *xslt_uri; /* XSL transform URI */
const char *fs_parent_path; /* path to parent of SVN FS'es */
enum conf_flag autoversioning; /* whether autoversioning is active */
- enum conf_flag bulk_updates; /* whether bulk updates are allowed */
+ dav_svn__bulk_upd_conf bulk_updates; /* whether bulk updates are allowed */
enum conf_flag v2_protocol; /* whether HTTP v2 is advertised */
enum path_authz_conf path_authz_method; /* how GET subrequests are handled */
enum conf_flag list_parentpath; /* whether to allow GET of parentpath */
@@ -213,7 +213,7 @@ create_dir_config(apr_pool_t *p, char *d
<Location /blah> directive. So we treat it as a urlpath. */
if (dir)
conf->root_dir = svn_urlpath__canonicalize(dir, p);
- conf->bulk_updates = CONF_FLAG_ON;
+ conf->bulk_updates = CONF_BULKUPD_ON;
conf->v2_protocol = CONF_FLAG_ON;
conf->hooks_env = NULL;
@@ -357,14 +357,26 @@ SVNAutoversioning_cmd(cmd_parms *cmd, vo
static const char *
-SVNAllowBulkUpdates_cmd(cmd_parms *cmd, void *config, int arg)
+SVNAllowBulkUpdates_cmd(cmd_parms *cmd, void *config, const char *arg1)
{
dir_conf_t *conf = config;
- if (arg)
- conf->bulk_updates = CONF_FLAG_ON;
+ if (apr_strnatcasecmp("on", arg1) == 0)
+ {
+ conf->bulk_updates = CONF_BULKUPD_ON;
+ }
+ else if (apr_strnatcasecmp("off", arg1) == 0)
+ {
+ conf->bulk_updates = CONF_BULKUPD_OFF;
+ }
+ else if (apr_strnatcasecmp("force", arg1) == 0)
+ {
+ conf->bulk_updates = CONF_BULKUPD_FORCE;
+ }
else
- conf->bulk_updates = CONF_FLAG_OFF;
+ {
+ return "Unrecognized value for SVNAllowBulkUpdates directive";
+ }
return NULL;
}
@@ -793,13 +805,13 @@ dav_svn__get_autoversioning_flag(request
}
-svn_boolean_t
+dav_svn__bulk_upd_conf
dav_svn__get_bulk_updates_flag(request_rec *r)
{
dir_conf_t *conf;
conf = ap_get_module_config(r->per_dir_config, &dav_svn_module);
- return conf->bulk_updates == CONF_FLAG_ON;
+ return conf->bulk_updates;
}
@@ -1144,11 +1156,12 @@ static const command_rec cmds[] =
"activities database(s) should be stored"),
/* per directory/location */
- AP_INIT_FLAG("SVNAllowBulkUpdates", SVNAllowBulkUpdates_cmd, NULL,
- ACCESS_CONF|RSRC_CONF,
- "enables support for bulk update-style requests (as opposed to "
- "only skeletal reports that require additional per-file "
- "downloads."),
+ AP_INIT_TAKE1("SVNAllowBulkUpdates", SVNAllowBulkUpdates_cmd, NULL,
+ ACCESS_CONF|RSRC_CONF,
+ "enables support for bulk update-style requests (On, default),
"
+ "as opposed to only skeletal reports that require additional "
+ "per-file downloads (Off). Use Force to always use bulk update
"
+ "responses, regardless of what the client requested."),
/* per directory/location */
AP_INIT_FLAG("SVNAdvertiseV2Protocol", SVNAdvertiseV2Protocol_cmd, NULL,
Modified: subversion/trunk/subversion/mod_dav_svn/reports/update.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/mod_dav_svn/reports/update.c?rev=1417639&r1=1417638&r2=1417639&view=diff
==============================================================================
--- subversion/trunk/subversion/mod_dav_svn/reports/update.c (original)
+++ subversion/trunk/subversion/mod_dav_svn/reports/update.c Wed Dec 5
20:46:33 2012
@@ -1016,11 +1016,17 @@ dav_svn__update_report(const dav_resourc
SVN_DAV_ERROR_TAG);
}
- /* If server configuration permits bulk updates (a report with props
- and textdeltas inline, rather than placeholder tags that tell the
- client to do further fetches), look to see if client requested as
- much. */
- if (repos->bulk_updates)
+ /* SVNAllowBulkUpdates On: server configuration permits bulk updates (a
report
+ with props and textdeltas inline, rather than placeholder tags that tell
+ the client to do further fetches), look to see if client requested as
+ much.
+
+ SVNAllowBulkUpdates Force: always use bulk updates, no matter what the
+ client requested.
+
+ SVNAllowBulkUpdates Off: no bulk updates allowed, force skelta mode.
+ */
+ if (repos->bulk_updates == CONF_BULKUPD_ON)
{
apr_xml_attr *this_attr;
@@ -1035,6 +1041,11 @@ dav_svn__update_report(const dav_resourc
}
}
}
+ else if (repos->bulk_updates == CONF_BULKUPD_FORCE)
+ {
+ uc.send_all = TRUE;
+ uc.include_props = TRUE;
+ }
/* Ask the repository about its youngest revision (which we'll need
for some input validation later). */