subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kot...@apache.org
Subject svn commit: r1803989 - in /subversion/trunk/subversion/libsvn_ra_serf: commit.c ra_serf.h util.c
Date Thu, 03 Aug 2017 12:30:33 GMT
Author: kotkov
Date: Thu Aug  3 12:30:33 2017
New Revision: 1803989

URL: http://svn.apache.org/viewvc?rev=1803989&view=rev
Log:
* subversion/libsvn_ra_serf/ra_serf.h
  (svn_ra_serf__is_local_network): Rename this function ...
  (svn_ra_serf__is_low_latency_connection): ... to this.  The old name could
   have been misleading, for example, considering local wireless connections
   with unstable latency.

* subversion/libsvn_ra_serf/util.c
  (svn_ra_serf__is_local_network): Rename this function ...
  (svn_ra_serf__is_low_latency_connection): ... to this.
  (svn_ra_serf__setup_svndiff_accept_encoding): Adjust its calling site,
   update a couple of comments here ...

* subversion/libsvn_ra_serf/commit.c
  (negotiate_put_encoding): ...and also here.

Suggested by: stsp, julianfoad
(See https://lists.apache.org/thread.html/e09c99ab3b15a1b84c601aae4d982da0482be95477f3c0708c5d4424@%3Cdev.subversion.apache.org%3E)

Modified:
    subversion/trunk/subversion/libsvn_ra_serf/commit.c
    subversion/trunk/subversion/libsvn_ra_serf/ra_serf.h
    subversion/trunk/subversion/libsvn_ra_serf/util.c

Modified: subversion/trunk/subversion/libsvn_ra_serf/commit.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/commit.c?rev=1803989&r1=1803988&r2=1803989&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/commit.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/commit.c Thu Aug  3 12:30:33 2017
@@ -1875,14 +1875,16 @@ negotiate_put_encoding(int *svndiff_vers
 
   if (session->using_compression == svn_tristate_unknown)
     {
-      /* With http-compression=auto, prefer svndiff2 over svndiff1 when
-       * working over a local network, as it is faster and in this case,
-       * we don't care about worse compression ratio.
+      /* With http-compression=auto, prefer svndiff2 to svndiff1 with a
+       * low latency connection (assuming the underlying network has high
+       * bandwidth), as it is faster and in this case, we don't care about
+       * worse compression ratio.
        *
        * Note: For future compatibility, we also handle a theoretically
        * possible case where the server has advertised only svndiff2 support.
        */
-      if (session->supports_svndiff2 && svn_ra_serf__is_local_network(session))
+      if (session->supports_svndiff2 &&
+          svn_ra_serf__is_low_latency_connection(session))
         svndiff_version = 2;
       else if (session->supports_svndiff1)
         svndiff_version = 1;

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=1803989&r1=1803988&r2=1803989&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/ra_serf.h (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/ra_serf.h Thu Aug  3 12:30:33 2017
@@ -1588,7 +1588,7 @@ svn_ra_serf__setup_svndiff_accept_encodi
                                            svn_ra_serf__session_t *session);
 
 svn_boolean_t
-svn_ra_serf__is_local_network(svn_ra_serf__session_t *session);
+svn_ra_serf__is_low_latency_connection(svn_ra_serf__session_t *session);
 
 /* Default limit for in-memory size of a request body. */
 #define SVN_RA_SERF__REQUEST_BODY_IN_MEM_SIZE 256 * 1024

Modified: subversion/trunk/subversion/libsvn_ra_serf/util.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/util.c?rev=1803989&r1=1803988&r2=1803989&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/util.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/util.c Thu Aug  3 12:30:33 2017
@@ -2036,11 +2036,12 @@ svn_ra_serf__setup_svndiff_accept_encodi
         headers, "Accept-Encoding", "svndiff");
     }
   else if (session->using_compression == svn_tristate_unknown &&
-           svn_ra_serf__is_local_network(session))
+           svn_ra_serf__is_low_latency_connection(session))
     {
       /* With http-compression=auto, advertise that we prefer svndiff2
-         over svndiff1 when working over a local network, as it is faster
-         and in this case, we don't care about worse compression ratio. */
+         to svndiff1 with a low latency connection (assuming the underlying
+         network has high bandwidth), as it is faster and in this case, we
+         don't care about worse compression ratio. */
       serf_bucket_headers_setn(
         headers, "Accept-Encoding",
         "gzip,svndiff2;q=0.9,svndiff1;q=0.8,svndiff;q=0.7");
@@ -2050,8 +2051,8 @@ svn_ra_serf__setup_svndiff_accept_encodi
       /* Otherwise, advertise that we prefer svndiff1 over svndiff2.
          svndiff2 is not a reasonable substitute for svndiff1 with default
          compression level, because, while it is faster, it also gives worse
-         compression ratio.  While we can use svndiff2 when working over
-         local networks (see above), we can't do this generally. */
+         compression ratio.  While we can use svndiff2 in some cases (see
+         above), we can't do this generally. */
       serf_bucket_headers_setn(
         headers, "Accept-Encoding",
         "gzip,svndiff1;q=0.9,svndiff2;q=0.8,svndiff;q=0.7");
@@ -2059,7 +2060,7 @@ svn_ra_serf__setup_svndiff_accept_encodi
 }
 
 svn_boolean_t
-svn_ra_serf__is_local_network(svn_ra_serf__session_t *session)
+svn_ra_serf__is_low_latency_connection(svn_ra_serf__session_t *session)
 {
   return session->conn_latency >= 0 &&
          session->conn_latency < apr_time_from_msec(5);



Mime
View raw message