Ivan Zhakov <i...@visualsvn.com> writes:

> Log message:
> [[[
> Add serf library version to svn --version output.
>
> * subversion/libsvn_ra_serf/serf.c
>   (RA_SERF_DESCRIPTION): Add version placeholders.
>   (ra_serf_get_description): Add serf library version information to RA layer
>    description.
> ]]]
>
> Thoughts?

I noticed today that the default user agent string produced by ra_serf
is

#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)

so it's fixed at compile time.  If I build against a serf shared library
and then upgrade the serf library the default user agent remains at the
old value.  I think the user agent should use serf_lib_version as well.

> Index: subversion/libsvn_ra_serf/serf.c
> ===================================================================
> --- subversion/libsvn_ra_serf/serf.c  (revision 1513462)
> +++ subversion/libsvn_ra_serf/serf.c  (working copy)
> @@ -59,13 +59,25 @@
>  }
>  
>  #define RA_SERF_DESCRIPTION \
> -    N_("Module for accessing a repository via WebDAV protocol using serf.")
> +    N_("Module for accessing a repository via WebDAV protocol using serf 
> %d.%d.%d.")
>  
>  /* Implements svn_ra__vtable_t.get_description(). */
>  static const char *
>  ra_serf_get_description(void)
>  {
> -  return _(RA_SERF_DESCRIPTION);
> +  static char description_buf[256];
> +  static char *description = NULL;
> +
> +  if (!description)
> +  {
> +      int major, minor, patch;
> +      serf_lib_version(&major, &minor, &patch);
> +      apr_snprintf(description_buf, sizeof(description_buf),
> +                   _(RA_SERF_DESCRIPTION), major, minor, patch);
> +      description = description_buf;
> +  }
> +
> +  return description;
>  }
>  
>  /* Implements svn_ra__vtable_t.get_schemes(). */

-- 
Philip Martin | Subversion Committer
WANdisco // *Non-Stop Data*

Reply via email to