On Fri, Jun 21, 2013 at 7:14 PM, Greg Stein <gst...@gmail.com> wrote: > > On Jun 21, 2013 10:36 AM, "Ivan Zhakov" <i...@visualsvn.com> wrote: >>.... >> >> Problem with this approach that some servers may support HTTP/1.1 >> >> partially. I.e. declare them as HTTP/1.1 but do not support chunked >> >> Transfer-Encoding. >> > >> > Then fix that problem. Add a flag saying "busted_http11" and make it >> > send requests with Content-Length after that. >> > >> Do you mean run-time configuration option like "http-force-http10 = yes"? > > Oh. Hadn't thought about that. I was thinking dynamic detection. > > I would favor dynamic over Yet Another Config Option, but you're the one > writing this code right now :-) > I'm also favor dynamic detection over config option. But I don't see good way to detect such busted proxies without introducing another request or risk breaking something when request completed in different order.
I suggest add config option as immediate fix, because problem reported at least five times. The fix seems to be pretty simple and could be safely backported (see patch). The only problem that probably we cannot backport addition of new configuration option due our backward compatibility policy. But may be I'm wrong. [[[[ Add new 'http-force-http10' configuration option to force using HTTP/1.0 even server declares HTTP/1.1 support. * subversion/include/svn_config.h (SVN_CONFIG_OPTION_HTTP_FORCE_HTTP10): New. * subversion/libsvn_ra_serf/ra_serf.h (svn_ra_serf__session_t): Add FORCE_HTTP10 flag. * subversion/libsvn_ra_serf/serf.c (load_config): Parse 'http-force-http10' configuration option. * subversion/libsvn_ra_serf/util.c (handle_response): Do not upgrade to HTTP/1.1 if force_http10 is true. * subversion/libsvn_subr/config_file.c (svn_config_ensure): Mention http-force-http10 in 'servers' file template. ]]]] (I'm not sure about option name) PS: I'm going to country until Tuesday, so feel free to commit and backport this patch. -- Ivan Zhakov
Index: subversion/include/svn_config.h =================================================================== --- subversion/include/svn_config.h (revision 1495417) +++ subversion/include/svn_config.h (working copy) @@ -95,6 +95,8 @@ #define SVN_CONFIG_OPTION_HTTP_BULK_UPDATES "http-bulk-updates" /** @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_FORCE_HTTP10 "http-force-http10" #define SVN_CONFIG_CATEGORY_CONFIG "config" #define SVN_CONFIG_SECTION_AUTH "auth" Index: subversion/libsvn_ra_serf/ra_serf.h =================================================================== --- subversion/libsvn_ra_serf/ra_serf.h (revision 1495455) +++ subversion/libsvn_ra_serf/ra_serf.h (working copy) @@ -144,6 +144,9 @@ HTTP/1.0. Thus, we cannot send chunked requests. */ svn_boolean_t http10; + /* Force using HTTP/1.0 even server declares HTTP/1.1 support. */ + svn_boolean_t force_http10; + /* Our Version-Controlled-Configuration; may be NULL until we know it. */ const char *vcc_url; Index: subversion/libsvn_ra_serf/serf.c =================================================================== --- subversion/libsvn_ra_serf/serf.c (revision 1495455) +++ subversion/libsvn_ra_serf/serf.c (working copy) @@ -225,6 +225,10 @@ SVN_CONFIG_OPTION_HTTP_MAX_CONNECTIONS, SVN_CONFIG_DEFAULT_OPTION_HTTP_MAX_CONNECTIONS)); + SVN_ERR(svn_config_get_bool(config, &session->force_http10, + SVN_CONFIG_SECTION_GLOBAL, + SVN_CONFIG_OPTION_HTTP_FORCE_HTTP10, FALSE)); + if (config) server_group = svn_config_find_group(config, session->session_url.hostname, @@ -281,6 +285,11 @@ server_group, SVN_CONFIG_OPTION_HTTP_MAX_CONNECTIONS, session->max_connections)); + + SVN_ERR(svn_config_get_bool(config, &session->force_http10, + server_group, + SVN_CONFIG_OPTION_HTTP_FORCE_HTTP10, + session->force_http10)); } /* Don't allow the http-max-connections value to be larger than our Index: subversion/libsvn_ra_serf/util.c =================================================================== --- subversion/libsvn_ra_serf/util.c (revision 1495455) +++ subversion/libsvn_ra_serf/util.c (working copy) @@ -1863,7 +1863,7 @@ handler->sline.reason = apr_pstrdup(handler->handler_pool, sl.reason); /* HTTP/1.1? (or later) */ - if (sl.version != SERF_HTTP_10) + if (sl.version != SERF_HTTP_10 && !handler->session->force_http10) handler->session->http10 = FALSE; } Index: subversion/libsvn_subr/config_file.c =================================================================== --- subversion/libsvn_subr/config_file.c (revision 1495417) +++ subversion/libsvn_subr/config_file.c (working copy) @@ -810,6 +810,8 @@ "### http-max-connections Maximum number of parallel server" NL "### connections to use for any given" NL "### HTTP operation." NL + "### http-force-http10 Force using HTTP/1.0 even server" NL + "### declares HTTP/1.1 support." NL "### neon-debug-mask Debug mask for Neon HTTP library" NL "### ssl-authority-files List of files, each of a trusted CA" NL