[PATCH RFC] hgweb: add config option for maxhttpheadersize

Steven Brown stevengbrown at gmail.com
Sun May 8 01:29:01 CDT 2011


On 7 May 2011 19:21, Sune Foldager <cryo at cyanite.org> wrote:
> On 2011-05-04 18:56, Sune Foldager wrote:
>>
>> On Wed, May 04, 2011 at 11:45:49 +0800, Steven Brown wrote:
>>>
>>> On 4 May 2011 04:47, Sune Foldager <cryo at cyanite.org> wrote:
>>>>
>>>> Does this look good to you? Setting it to 0, the new
>>>> arguments-in-headers
>>>> option can then be disabled, for debug or other purposes.
>>>>
>>>> -Sune
>>>
>>> Yeah generally looks good. This is what I had in mind for a config
>>> option.
>>>
>>> Comments:
>>> - Why the "server" section, rather than "web" ?
>>
>> Yeah, true... since it's only http, it should be in web.
>>
>>> - The tests are a little strange to read. I'd prefer see HGPORT1 with
>>> error1.log, access1.log, and so on.
>>
>> Myeah but blame those who defined HGPORT, HGPORT1 and HGPORT2 :p.
>> But I'll just name them access0.log etc. to fix it :)
>>
>>> - Another test case would be a non-zero and non-default option, e.g.
>>> 10 characters.
>>
>> Right, I'll look at it. Thanks.
>
> Coming to think of it, this maximum buissiness is a bit weird, isn't it?
> It should rather be a minimum. I mean, if there isn't enough room in the
> headers, there surely won't be enough room in the request line. This goes
> for the value sent over the wire as well. Do we have time to change this to
> a minimum instead (since it's only been in for some days), or what do you
> think?
>
> Sune
>

A config option for the maximum URL length would be clearer.

As I see it, we are dealing with two separate values:

(a) The maximum size of each header
- Currently provided in the httpheader capability.
- Hard-coded to 1024 on the server.
- A config option would allow more data to be sent in each header.
(Hopefully Mercurial will not require this.)

(b) The maximum URL length
- If the client would produce a URL that is over this length, it
switches to using the headers instead.
- Implicitly hard-coded to 0 on the client.
- A config option would allow smaller requests to appear in the web
server's access log.

I'm fine with adding a config option for (b).

But please don't hard-code (a) on the client. This value should come
from the server, rather than the client making a guess of what the
server will accept. This also gives us the flexibility (just in case)
to add a config option or an extension to control this value in
future.

Cheers,
Steve.


More information about the Mercurial-devel mailing list