PATCH: set User-Agent string in HTTP transport
James Henstridge
james.henstridge at gmail.com
Tue Feb 7 01:48:05 GMT 2006
On 06/02/06, Martin Pool <mbp at sourcefrog.net> wrote:
> On 6 Feb 2006, James Henstridge <james.henstridge at gmail.com> wrote:
> > On 06/02/06, Robert Collins <robertc at robertcollins.net> wrote:
> > > Thanks James. We actually have all the machinery to do that already in
> > > bzrlib.transport.http.HttpServer - it should be a simple matter (i.e.
> > > using 'TestCaseWithHTTPServer' which already exists) to use that in
> > > writing the test - i.e. by having it log the user agent as one of the
> > > fields in the log of the request. I think this would be better than a
> > > whole new server-in-a-thread implementation.
> >
> > Good point. I've updated the test (attached) to use this approach.
> > There was already a TestCaseWithWebserver in
> > bzrlib.tests.HTTPTestUtil, so I used that.
> >
> > I also simplified the HttpServer initialisation code a little to let
> > the OS allocate the port number rather than sequentially trying a
> > range of ports to bind to. This should be a bit more robust than the
> > existing code.
>
> +1
Okay, the user-agent change, the added test, and the HttpServer fix
are all on my branch ready to be merged:
http://people.ubuntu.com/~jamesh/bzr.smallfixes
James.
More information about the bazaar
mailing list