Author: cmpilato
Date: Thu Apr 14 14:54:04 2011
New Revision: 1092310
URL: http://svn.apache.org/viewvc?rev=1092310&view=rev
Log:
Allow client-side disablement of HTTPv2 support for ra_neon, too.
* subversion/libsvn_ra_neon/options.c
(parse_capabilities): Recognize SVN_I_LIKE_LATENCY_SO_IGNORE_HTTPV2
environment variable as a way to disable HTTPv2 support in ra_neon
as we do for ra_serf.
* notes/knobs
Update documentation for SVN_I_LIKE_LATENCY_SO_IGNORE_HTTPV2 to be a
little more useful.
Modified:
subversion/trunk/notes/knobs
subversion/trunk/subversion/libsvn_ra_neon/options.c
Modified: subversion/trunk/notes/knobs
URL:
http://svn.apache.org/viewvc/subversion/trunk/notes/knobs?rev=1092310&r1=1092309&r2=1092310&view=diff
==============================================================================
--- subversion/trunk/notes/knobs (original)
+++ subversion/trunk/notes/knobs Thu Apr 14 14:54:04 2011
@@ -50,7 +50,12 @@ Environment variables:
* SVNSYNC_UNSUPPORTED_MIGRATE_SVNMERGE
* SVN_I_LOVE_CORRUPTED_WORKING_COPIES_SO_DISABLE_RELOCATE_VALIDATION
* SVN_I_LOVE_CORRUPTED_WORKING_COPIES_SO_DISABLE_SLEEP_FOR_TIMESTAMPS
-* SVN_I_LIKE_LATENCY_SO_IGNORE_HTTPV2 (libsvn_ra_serf)
+
+* SVN_I_LIKE_LATENCY_SO_IGNORE_HTTPV2
+ Scope: libsvn_ra_neon and libsvn_ra_serf, if SVN_DEBUG
+ Purpose: A "yes" value causes the RA modules to ignore the server's
+ advertisement of HTTPv2 protocol support (if any), effectively
+ causing them to only speak our original HTTP protocol.
* (TODO: others)
Modified: subversion/trunk/subversion/libsvn_ra_neon/options.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_neon/options.c?rev=1092310&r1=1092309&r2=1092310&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_neon/options.c (original)
+++ subversion/trunk/subversion/libsvn_ra_neon/options.c Thu Apr 14 14:54:04
2011
@@ -34,6 +34,8 @@
#include "ra_neon.h"
+#define SVN_IGNORE_V2_ENV_VAR "SVN_I_LIKE_LATENCY_SO_IGNORE_HTTPV2"
+
static const svn_ra_neon__xml_elm_t options_elements[] =
{
{ "DAV:", "activity-collection-set", ELEM_activity_coll_set, 0 },
@@ -235,7 +237,19 @@ parse_capabilities(ne_request *req,
/* HTTP v2 stuff */
if ((val = ne_get_response_header(req, SVN_DAV_ME_RESOURCE_HEADER)))
{
- ras->me_resource = apr_pstrdup(ras->pool, val);
+#ifdef SVN_DEBUG
+ /* ### This section is throw in here for development use. It
+ ### allows devs the chance to force the client to speak v1,
+ ### even if the server is capable of speaking v2. We should
+ ### probably remove it before 1.7 goes final. */
+ char *ignore_v2_env_var = getenv(SVN_IGNORE_V2_ENV_VAR);
+
+ if (! (ignore_v2_env_var
+ && apr_strnatcasecmp(ignore_v2_env_var, "yes") == 0))
+ ras->me_resource = apr_pstrdup(ras->pool, val);
+#else
+ ras->me_resource = apr_pstrdup(ras->pool, val);
+#endif
}
if ((val = ne_get_response_header(req, SVN_DAV_REV_ROOT_STUB_HEADER)))
{