You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by sv...@apache.org on 2013/08/17 06:01:24 UTC

svn commit: r1514946 - in /subversion/branches/1.8.x: ./ STATUS subversion/libsvn_ra_serf/ra_serf.h subversion/libsvn_ra_serf/serf.c

Author: svn-role
Date: Sat Aug 17 04:01:23 2013
New Revision: 1514946

URL: http://svn.apache.org/r1514946
Log:
Merge the r1514315 group from trunk:

 * r1514315, r1514628
   Use loaded serf version for User-Agent, not version used for compilation.
   Justification:
     Wrong User-Agent string is not good thing.
   Votes:
     +1: ivan, danielsh, philip

Modified:
    subversion/branches/1.8.x/   (props changed)
    subversion/branches/1.8.x/STATUS
    subversion/branches/1.8.x/subversion/libsvn_ra_serf/ra_serf.h
    subversion/branches/1.8.x/subversion/libsvn_ra_serf/serf.c

Propchange: subversion/branches/1.8.x/
------------------------------------------------------------------------------
  Merged /subversion/trunk:r1514315,1514628

Modified: subversion/branches/1.8.x/STATUS
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x/STATUS?rev=1514946&r1=1514945&r2=1514946&view=diff
==============================================================================
--- subversion/branches/1.8.x/STATUS (original)
+++ subversion/branches/1.8.x/STATUS Sat Aug 17 04:01:23 2013
@@ -262,10 +262,3 @@ Veto-blocked changes:
 
 Approved changes:
 =================
-
- * r1514315, r1514628
-   Use loaded serf version for User-Agent, not version used for compilation.
-   Justification:
-     Wrong User-Agent string is not good thing.
-   Votes:
-     +1: ivan, danielsh, philip

Modified: subversion/branches/1.8.x/subversion/libsvn_ra_serf/ra_serf.h
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x/subversion/libsvn_ra_serf/ra_serf.h?rev=1514946&r1=1514945&r2=1514946&view=diff
==============================================================================
--- subversion/branches/1.8.x/subversion/libsvn_ra_serf/ra_serf.h (original)
+++ subversion/branches/1.8.x/subversion/libsvn_ra_serf/ra_serf.h Sat Aug 17 04:01:23 2013
@@ -57,13 +57,6 @@ extern "C" {
 /** Use this to silence compiler warnings about unused parameters. */
 #define UNUSED_CTX(x) ((void)(x))
 
-/** Our User-Agent string. */
-#define USER_AGENT "SVN/" SVN_VER_NUMBER " (" SVN_BUILD_TARGET ")" \
-                   " serf/" \
-                   APR_STRINGIFY(SERF_MAJOR_VERSION) "." \
-                   APR_STRINGIFY(SERF_MINOR_VERSION) "." \
-                   APR_STRINGIFY(SERF_PATCH_VERSION)
-
 /** Wait duration (in microseconds) used in calls to serf_context_run() */
 #define SVN_RA_SERF__CONTEXT_RUN_DURATION 500000
 

Modified: subversion/branches/1.8.x/subversion/libsvn_ra_serf/serf.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x/subversion/libsvn_ra_serf/serf.c?rev=1514946&r1=1514945&r2=1514946&view=diff
==============================================================================
--- subversion/branches/1.8.x/subversion/libsvn_ra_serf/serf.c (original)
+++ subversion/branches/1.8.x/subversion/libsvn_ra_serf/serf.c Sat Aug 17 04:01:23 2013
@@ -413,6 +413,18 @@ svn_ra_serf__progress(void *progress_bat
     }
 }
 
+/** Our User-Agent string. */
+static const char *
+get_user_agent_string(apr_pool_t *pool)
+{
+  int major, minor, patch;
+  serf_lib_version(&major, &minor, &patch);
+
+  return apr_psprintf(pool, "SVN/%s (%s) serf/%d.%d.%d",
+                      SVN_VER_NUMBER, SVN_BUILD_TARGET,
+                      major, minor, patch);
+}
+
 /* Implements svn_ra__vtable_t.open_session(). */
 static svn_error_t *
 svn_ra_serf__open(svn_ra_session_t *session,
@@ -495,10 +507,10 @@ svn_ra_serf__open(svn_ra_session_t *sess
     SVN_ERR(callbacks->get_client_string(callback_baton, &client_string, pool));
 
   if (client_string)
-    serf_sess->useragent = apr_pstrcat(pool, USER_AGENT, " ",
+    serf_sess->useragent = apr_pstrcat(pool, get_user_agent_string(pool), " ",
                                        client_string, (char *)NULL);
   else
-    serf_sess->useragent = USER_AGENT;
+    serf_sess->useragent = get_user_agent_string(pool);
 
   /* go ahead and tell serf about the connection. */
   status =