Author: lgo
Date: Thu Dec 6 20:54:47 2012
New Revision: 1418071
URL: http://svn.apache.org/viewvc?rev=1418071&view=rev
Log:
Follow up r1417639: older clients with serf don't support bulk update mode, so
the server can't force it.
Changed it slightly, so that the server admin can express preference -
SVNAllowBulkUpdates Off for mandatory skelta, Prefer for bulk updates if
supported by the client, and On for "client decides".
A 1.8 server will now add a header in the OPTIONS response which indicates
these server preferences, so that ra_serf can react properly.
* subversion/include/svn_dav.h
(SVN_DAV_ALLOW_BULK_UPDATES): Add svn header for OPTIONS response.
* subversion/mod_dav_svn/dav_svn.h
(enum dav_svn__bulk_upd_conf): Rename option from FORCE to PREFER.
* subversion/mod_dav_svn/mod_dav_svn.c
(SVNAllowBulkUpdates_cmd,
const command_rec cmds): Rename option from Force to Prefer.
* subversion/mod_dav_svn/reports/update.c
(dav_svn__update_report): If bulk updates are allowed, set send-all=true, but
only if the client asked for this mode.
* subversion/mod_dav_svn/version.c
(get_option): Add the SVN_DAV_ALLOW_BULK_UPDATES header to the OPTIONS
response.
Modified:
subversion/trunk/subversion/include/svn_dav.h
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
subversion/trunk/subversion/mod_dav_svn/version.c
Modified: subversion/trunk/subversion/include/svn_dav.h
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_dav.h?rev=1418071&r1=1418070&r2=1418071&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_dav.h (original)
+++ subversion/trunk/subversion/include/svn_dav.h Thu Dec 6 20:54:47 2012
@@ -192,6 +192,11 @@ extern "C" {
* @since New in 1.8. */
#define SVN_DAV_SUPPORTED_POSTS_HEADER "SVN-Supported-Posts"
+/** This header is used in the OPTIONS response to indicate if the server
+ * wants bulk update requests (Prefer) or only accepts skelta requests (Off).
+ * If this value is On both options are allowed.
+ * @since New in 1.8. */
+#define SVN_DAV_ALLOW_BULK_UPDATES "SVN-Allow-Bulk-Updates"
/**
* @name Fulltext MD5 headers
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=1418071&r1=1418070&r2=1418071&view=diff
==============================================================================
--- subversion/trunk/subversion/mod_dav_svn/dav_svn.h (original)
+++ subversion/trunk/subversion/mod_dav_svn/dav_svn.h Thu Dec 6 20:54:47 2012
@@ -56,7 +56,7 @@ extern "C" {
typedef enum dav_svn__bulk_upd_conf {
CONF_BULKUPD_ON,
CONF_BULKUPD_OFF,
- CONF_BULKUPD_FORCE
+ CONF_BULKUPD_PREFER
} dav_svn__bulk_upd_conf;
/* dav_svn_repos
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=1418071&r1=1418070&r2=1418071&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 6 20:54:47
2012
@@ -369,9 +369,9 @@ SVNAllowBulkUpdates_cmd(cmd_parms *cmd,
{
conf->bulk_updates = CONF_BULKUPD_OFF;
}
- else if (apr_strnatcasecmp("force", arg1) == 0)
+ else if (apr_strnatcasecmp("prefer", arg1) == 0)
{
- conf->bulk_updates = CONF_BULKUPD_FORCE;
+ conf->bulk_updates = CONF_BULKUPD_PREFER;
}
else
{
@@ -1160,8 +1160,8 @@ static const command_rec cmds[] =
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-file downloads (Off). Use Prefer to tell the svn client "
+ "to always use bulk update requests, if supported."),
/* 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=1418071&r1=1418070&r2=1418071&view=diff
==============================================================================
--- subversion/trunk/subversion/mod_dav_svn/reports/update.c (original)
+++ subversion/trunk/subversion/mod_dav_svn/reports/update.c Thu Dec 6
20:54:47 2012
@@ -1016,17 +1016,15 @@ dav_svn__update_report(const dav_resourc
SVN_DAV_ERROR_TAG);
}
- /* 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 On/Prefer: 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 Off: no bulk updates allowed, force skelta mode.
*/
- if (repos->bulk_updates == CONF_BULKUPD_ON)
+ if (repos->bulk_updates == CONF_BULKUPD_ON ||
+ repos->bulk_updates == CONF_BULKUPD_PREFER)
{
apr_xml_attr *this_attr;
@@ -1041,11 +1039,6 @@ 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). */
Modified: subversion/trunk/subversion/mod_dav_svn/version.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/mod_dav_svn/version.c?rev=1418071&r1=1418070&r2=1418071&view=diff
==============================================================================
--- subversion/trunk/subversion/mod_dav_svn/version.c (original)
+++ subversion/trunk/subversion/mod_dav_svn/version.c Thu Dec 6 20:54:47 2012
@@ -247,7 +247,8 @@ get_option(const dav_resource *resource,
{
int i;
svn_version_t *master_version = dav_svn__get_master_version(r);
-
+ dav_svn__bulk_upd_conf bulk_upd_conf = dav_svn__get_bulk_updates_flag(r);
+
/* The list of Subversion's custom POSTs and which versions of
Subversion support them. We need this latter information
when acting as a WebDAV slave -- we don't want to claim
@@ -286,6 +287,9 @@ get_option(const dav_resource *resource,
apr_table_set(r->headers_out, SVN_DAV_VTXN_STUB_HEADER,
apr_pstrcat(resource->pool, repos_root_uri, "/",
dav_svn__get_vtxn_stub(r), (char *)NULL));
+ apr_table_set(r->headers_out, SVN_DAV_ALLOW_BULK_UPDATES,
+ bulk_upd_conf == CONF_BULKUPD_ON ? "On" :
+ bulk_upd_conf == CONF_BULKUPD_OFF ? "Off" : "Prefer");
/* Report the supported POST types. */
for (i = 0; i < sizeof(posts_versions)/sizeof(posts_versions[0]); ++i)