You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by gs...@apache.org on 2013/06/29 04:00:07 UTC

svn commit: r1497975 - in /subversion/trunk/subversion: include/svn_config.h libsvn_ra_serf/ra_serf.h libsvn_ra_serf/serf.c libsvn_subr/config_file.c

Author: gstein
Date: Sat Jun 29 02:00:07 2013
New Revision: 1497975

URL: http://svn.apache.org/r1497975
Log:
Switch the config name and semantics to busted-proxy.

For now, it retains the static configuration-based behavior. Future
work will perform runtime detection.

* subversion/include/svn_config.h:
  (SVN_CONFIG_OPTION_HTTP_CHUNKED_REQUESTS): renamed to ...
  (SVN_CONFIG_OPTION_BUSTED_PROXY): ... this

* subversion/libsvn_ra_serf/ra_serf.h:
  (svn_ra_serf__session_t): change USING_PROXY to boolean. add
    BUSTED_PROXY flag (loaded from config)

* subversion/libsvn_ra_serf/serf.c:
  (load_config): load the BUSTED_PROXY configuration data. if a proxy
    is being used and the proxy may be busted, then disable chunked
    requests
  (svn_ra_serf__open): initialize USING_CHUNKED_REQUESTS

* subversion/libsvn_subr/config_file.c:
  (svn_config_ensure): rename flag and adjust description

Modified:
    subversion/trunk/subversion/include/svn_config.h
    subversion/trunk/subversion/libsvn_ra_serf/ra_serf.h
    subversion/trunk/subversion/libsvn_ra_serf/serf.c
    subversion/trunk/subversion/libsvn_subr/config_file.c

Modified: subversion/trunk/subversion/include/svn_config.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_config.h?rev=1497975&r1=1497974&r2=1497975&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_config.h (original)
+++ subversion/trunk/subversion/include/svn_config.h Sat Jun 29 02:00:07 2013
@@ -96,7 +96,7 @@ typedef struct svn_config_t svn_config_t
 /** @since New in 1.8. */
 #define SVN_CONFIG_OPTION_HTTP_MAX_CONNECTIONS      "http-max-connections"
 /** @since New in 1.9. */
-#define SVN_CONFIG_OPTION_HTTP_CHUNKED_REQUESTS     "http-chunked-requests"
+#define SVN_CONFIG_OPTION_BUSTED_PROXY              "busted-proxy"
 
 #define SVN_CONFIG_CATEGORY_CONFIG          "config"
 #define SVN_CONFIG_SECTION_AUTH                 "auth"

Modified: subversion/trunk/subversion/libsvn_ra_serf/ra_serf.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/ra_serf.h?rev=1497975&r1=1497974&r2=1497975&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/ra_serf.h (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/ra_serf.h Sat Jun 29 02:00:07 2013
@@ -189,7 +189,11 @@ struct svn_ra_serf__session_t {
   const char *activity_collection_url;
 
   /* Are we using a proxy? */
-  int using_proxy;
+  svn_boolean_t using_proxy;
+
+  /* Should we be careful with this proxy? (some have insufficient support that
+     we need to work around).  */
+  svn_boolean_t busted_proxy;
 
   const char *proxy_username;
   const char *proxy_password;

Modified: subversion/trunk/subversion/libsvn_ra_serf/serf.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/serf.c?rev=1497975&r1=1497974&r2=1497975&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/serf.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/serf.c Sat Jun 29 02:00:07 2013
@@ -225,10 +225,11 @@ load_config(svn_ra_serf__session_t *sess
                                SVN_CONFIG_OPTION_HTTP_MAX_CONNECTIONS,
                                SVN_CONFIG_DEFAULT_OPTION_HTTP_MAX_CONNECTIONS));
 
-  SVN_ERR(svn_config_get_bool(config, &session->using_chunked_requests,
+  /* Is this proxy potentially busted? Do we need to take special care?  */
+  SVN_ERR(svn_config_get_bool(config, &session->busted_proxy,
                               SVN_CONFIG_SECTION_GLOBAL,
-                              SVN_CONFIG_OPTION_HTTP_CHUNKED_REQUESTS,
-                              TRUE));
+                              SVN_CONFIG_OPTION_BUSTED_PROXY,
+                              FALSE));
 
   if (config)
     server_group = svn_config_find_group(config,
@@ -287,11 +288,12 @@ load_config(svn_ra_serf__session_t *sess
                                    SVN_CONFIG_OPTION_HTTP_MAX_CONNECTIONS,
                                    session->max_connections));
 
+      /* Do we need to take care with this proxy?  */
       SVN_ERR(svn_config_get_bool(
-               config, &session->using_chunked_requests,
+               config, &session->busted_proxy,
                server_group,
-               SVN_CONFIG_OPTION_HTTP_CHUNKED_REQUESTS,
-               session->using_chunked_requests));
+               SVN_CONFIG_OPTION_BUSTED_PROXY,
+               session->busted_proxy));
     }
 
   /* Don't allow the http-max-connections value to be larger than our
@@ -366,6 +368,12 @@ load_config(svn_ra_serf__session_t *sess
       session->using_proxy = FALSE;
     }
 
+  /* If we're using a proxy, *and* it might be busted,
+     then disable chunked requests.  */
+  /* ### we'll switch this to dynamic shortly.  */
+  if (session->using_proxy && session->busted_proxy)
+    session->using_chunked_requests = FALSE;
+
   /* Setup authentication. */
   SVN_ERR(load_http_auth_types(pool, config, server_group,
                                &session->authn_types));
@@ -453,6 +461,10 @@ svn_ra_serf__open(svn_ra_session_t *sess
      HTTP/1.1 is supported, we can upgrade. */
   serf_sess->http10 = TRUE;
 
+  /* If we switch to HTTP/1.1, then we will use chunked requests. We may disable
+     this, if we find an intervening proxy does not support chunked requests.  */
+  serf_sess->using_chunked_requests = TRUE;
+
   SVN_ERR(load_config(serf_sess, config, serf_sess->pool));
 
   serf_sess->conns[0] = apr_pcalloc(serf_sess->pool,

Modified: subversion/trunk/subversion/libsvn_subr/config_file.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/config_file.c?rev=1497975&r1=1497974&r2=1497975&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/config_file.c (original)
+++ subversion/trunk/subversion/libsvn_subr/config_file.c Sat Jun 29 02:00:07 2013
@@ -810,8 +810,9 @@ svn_config_ensure(const char *config_dir
         "###   http-max-connections       Maximum number of parallel server" NL
         "###                              connections to use for any given"  NL
         "###                              HTTP operation."                   NL
-        "###   http-chunked-requests      Whether to use chunked transfer"   NL
-        "###                              encoding for HTTP requests body."  NL
+        "###   busted-proxy               The proxy may have some protocol"  NL
+        "###                              issues that Subversion needs to"   NL
+        "###                              detect and work around."           NL
         "###   neon-debug-mask            Debug mask for Neon HTTP library"  NL
         "###   ssl-authority-files        List of files, each of a trusted CA"
                                                                              NL



Re: svn commit: r1497975 - in /subversion/trunk/subversion: include/svn_config.h libsvn_ra_serf/ra_serf.h libsvn_ra_serf/serf.c libsvn_subr/config_file.c

Posted by Greg Stein <gs...@gmail.com>.
On Sat, Jun 29, 2013 at 3:05 PM, Ivan Zhakov <iv...@visualsvn.com> wrote:
> On Saturday, June 29, 2013, wrote:
>>
>> Author: gstein
>> Date: Sat Jun 29 02:00:07 2013
>> New Revision: 1497975
>>
>> URL: http://svn.apache.org/r1497975
>> Log:
>> Switch the config name and semantics to busted-proxy.
>>
>> For now, it retains the static configuration-based behavior. Future
>> work will perform runtime detection.
>>
>> * subversion/include/svn_config.h:
>>   (SVN_CONFIG_OPTION_HTTP_CHUNKED_REQUESTS): renamed to ...
>>   (SVN_CONFIG_OPTION_BUSTED_PROXY): ... this
>>
>> * subversion/libsvn_ra_serf/ra_serf.h:
>>   (svn_ra_serf__session_t): change USING_PROXY to boolean. add
>>     BUSTED_PROXY flag (loaded from config)
>>
>> * subversion/libsvn_ra_serf/serf.c:
>>   (load_config): load the BUSTED_PROXY configuration data. if a proxy
>>     is being used and the proxy may be busted, then disable chunked
>>     requests
>>   (svn_ra_serf__open): initialize USING_CHUNKED_REQUESTS
>>
>> * subversion/libsvn_subr/config_file.c:
>>   (svn_config_ensure): rename flag and adjust description
>
> As I already said on the list forward (client side) proxies are not issue

Sure, I saw that but just hadn't fixed it yet.

Now done in r1498012.

>...

Cheers,
-g

Re: svn commit: r1497975 - in /subversion/trunk/subversion: include/svn_config.h libsvn_ra_serf/ra_serf.h libsvn_ra_serf/serf.c libsvn_subr/config_file.c

Posted by Greg Stein <gs...@gmail.com>.
On Sat, Jun 29, 2013 at 3:05 PM, Ivan Zhakov <iv...@visualsvn.com> wrote:
> On Saturday, June 29, 2013, wrote:
>>
>> Author: gstein
>> Date: Sat Jun 29 02:00:07 2013
>> New Revision: 1497975
>>
>> URL: http://svn.apache.org/r1497975
>> Log:
>> Switch the config name and semantics to busted-proxy.
>>
>> For now, it retains the static configuration-based behavior. Future
>> work will perform runtime detection.
>>
>> * subversion/include/svn_config.h:
>>   (SVN_CONFIG_OPTION_HTTP_CHUNKED_REQUESTS): renamed to ...
>>   (SVN_CONFIG_OPTION_BUSTED_PROXY): ... this
>>
>> * subversion/libsvn_ra_serf/ra_serf.h:
>>   (svn_ra_serf__session_t): change USING_PROXY to boolean. add
>>     BUSTED_PROXY flag (loaded from config)
>>
>> * subversion/libsvn_ra_serf/serf.c:
>>   (load_config): load the BUSTED_PROXY configuration data. if a proxy
>>     is being used and the proxy may be busted, then disable chunked
>>     requests
>>   (svn_ra_serf__open): initialize USING_CHUNKED_REQUESTS
>>
>> * subversion/libsvn_subr/config_file.c:
>>   (svn_config_ensure): rename flag and adjust description
>
> As I already said on the list forward (client side) proxies are not issue

Sure, I saw that but just hadn't fixed it yet.

Now done in r1498012.

>...

Cheers,
-g

Re: svn commit: r1497975 - in /subversion/trunk/subversion: include/svn_config.h libsvn_ra_serf/ra_serf.h libsvn_ra_serf/serf.c libsvn_subr/config_file.c

Posted by Ivan Zhakov <iv...@visualsvn.com>.
On Saturday, June 29, 2013, wrote:

> Author: gstein
> Date: Sat Jun 29 02:00:07 2013
> New Revision: 1497975
>
> URL: http://svn.apache.org/r1497975
> Log:
> Switch the config name and semantics to busted-proxy.
>
> For now, it retains the static configuration-based behavior. Future
> work will perform runtime detection.
>
> * subversion/include/svn_config.h:
>   (SVN_CONFIG_OPTION_HTTP_CHUNKED_REQUESTS): renamed to ...
>   (SVN_CONFIG_OPTION_BUSTED_PROXY): ... this
>
> * subversion/libsvn_ra_serf/ra_serf.h:
>   (svn_ra_serf__session_t): change USING_PROXY to boolean. add
>     BUSTED_PROXY flag (loaded from config)
>
> * subversion/libsvn_ra_serf/serf.c:
>   (load_config): load the BUSTED_PROXY configuration data. if a proxy
>     is being used and the proxy may be busted, then disable chunked
>     requests
>   (svn_ra_serf__open): initialize USING_CHUNKED_REQUESTS
>
> * subversion/libsvn_subr/config_file.c:
>   (svn_config_ensure): rename flag and adjust description
>
> As I already said on the list forward (client side) proxies are not issue
anyway: most forward proxies does not support HTTP methods other than
GET/POST. https proxies are not issue since it is only tunnel. And actually
nobody complained about forward proxies.

Problem is reverse proxy, while you patch does not help for case reported
many times.

----
Ivan Zhakov


-- 
Ivan Zhakov
CTO | VisualSVN | http://www.visualsvn.com

Re: svn commit: r1497975 - in /subversion/trunk/subversion: include/svn_config.h libsvn_ra_serf/ra_serf.h libsvn_ra_serf/serf.c libsvn_subr/config_file.c

Posted by Ivan Zhakov <iv...@visualsvn.com>.
On Saturday, June 29, 2013, wrote:

> Author: gstein
> Date: Sat Jun 29 02:00:07 2013
> New Revision: 1497975
>
> URL: http://svn.apache.org/r1497975
> Log:
> Switch the config name and semantics to busted-proxy.
>
> For now, it retains the static configuration-based behavior. Future
> work will perform runtime detection.
>
> * subversion/include/svn_config.h:
>   (SVN_CONFIG_OPTION_HTTP_CHUNKED_REQUESTS): renamed to ...
>   (SVN_CONFIG_OPTION_BUSTED_PROXY): ... this
>
> * subversion/libsvn_ra_serf/ra_serf.h:
>   (svn_ra_serf__session_t): change USING_PROXY to boolean. add
>     BUSTED_PROXY flag (loaded from config)
>
> * subversion/libsvn_ra_serf/serf.c:
>   (load_config): load the BUSTED_PROXY configuration data. if a proxy
>     is being used and the proxy may be busted, then disable chunked
>     requests
>   (svn_ra_serf__open): initialize USING_CHUNKED_REQUESTS
>
> * subversion/libsvn_subr/config_file.c:
>   (svn_config_ensure): rename flag and adjust description
>
> As I already said on the list forward (client side) proxies are not issue
anyway: most forward proxies does not support HTTP methods other than
GET/POST. https proxies are not issue since it is only tunnel. And actually
nobody complained about forward proxies.

Problem is reverse proxy, while you patch does not help for case reported
many times.

----
Ivan Zhakov


-- 
Ivan Zhakov
CTO | VisualSVN | http://www.visualsvn.com