[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] Add platform information to user agent string

From: Branko ─îibej <brane_at_wandisco.com>
Date: Tue, 30 Oct 2012 23:04:39 +0100

On 30.10.2012 21:25, Ivan Zhakov wrote:
> On Tue, Oct 30, 2012 at 10:42 PM, C. Michael Pilato <cmpilato_at_collab.net> wrote:
>> On 10/30/2012 02:15 PM, Julian Foad wrote:
>>> Ivan Zhakov wrote:
>>>
>>>> On Tue, Oct 30, 2012 at 8:07 PM, Ben Reser wrote:
>>>>> On Tue, Oct 30, 2012 at 8:28 AM, Ivan Zhakov wrote:
>>>>>> I think it will be useful to add client platform information to
>>>>>> user agent string, to use it Apache HTTP Server configuration or
>>>>>> Subversion hooks. Within my patch applied user agent will be like
>>>>>> this: SVN/1.8.0 (Windows) serf/1.1.1 TortoiseSVN/1.8.0 SVN/1.8.0
>>>>>> (Macintosh) serf/1.1.1 SVN/1.8.0 (FreeBSD) serf/1.1.1
>>>>> Useful how?
>>>> For example to disable plain-text basic authentication on Windows. Or
>>>> disable commits from Linux using pre-commit hook.
>>> (1) Brane has recently added platform identification to the 'svn
>>> --version' command; is there any reason to use different code here
>>> producing a different set of platform identifiers? It would seem much
>>> better to share that code -- whether using just the 'platform' string or
>>> the whole 'platform-cpu-vendor' (or whatever it is) tuple -- so that the
>>> two sets of client identifiers cannot get out of sync.
>> Agreed that there should be a single canonical source of "build
>> information", and that the work Brane has done seems the reasonable best
>> candidate of such.
>>
> I completely agree that it would be great to have one code to get
> platform information. But current svn_sysinfo* implementation provides
> detailed information which very expensive to obtain. In some codepath
> we have to execute external commands. This is fine for separate
> command, but I think that's does makes sense for every Subversion
> library call. That's why I suggest use static build time information
> in user-agent string.

The sysinfo bits have static (build-time) info and dynamic (runtime)
info. Presumably the only difference will be noticing when you're
running the program on a different "size" of OS, e.g., running 32-bit
code on a 64-bit OS (hopefully in some compatibility mode).

For the purpose of user agent strings, the host triplet exposed in the
#define in svn_private_config.h should be more than good enough.

-- Brane
Received on 2012-10-30 23:05:16 CET

This is an archived mail posted to the Subversion Dev mailing list.