[PATCH] httprepo: long arguments support (issue2126)

Steven Brown stevengbrown at gmail.com
Sun Mar 20 20:15:43 CDT 2011


On 20 March 2011 23:27, Matt Mackall <mpm at selenic.com> wrote:
> On Sun, 2011-03-20 at 18:10 +0800, Steven Brown wrote:
>> # HG changeset patch
>> # User Steven Brown <StevenGBrown at gmail.com>
>> # Date 1300614413 -28800
>> # Node ID dd1002a1476d86eace9724ef04b502b724fc0525
>> # Parent  48d606d7192b6f8f4fc8071fccdc5a83843ab2d3
>> httprepo: long arguments support (issue2126)
>>
>> Send the command arguments in the HTTP request body. The command is still part
>> of the URL. If the server does not have the 'longargs' capability, the client
>> will send the command arguments in the URL as it did previously.
>>
>> When sending both command arguments and additional data in the same request,
>> the client adds a 'datastart' field to the URL. The server uses this to
>> determine where the command arguments end and the additional data begins.
>
> One of the reasons we were focusing on stashing stuff in headers is that
> some folks might be relying on non-push requests being GETs in their web
> server access rules. I'm not sure if this is a real problem, though.
> Obviously, a POST approach is a lot cleaner.

Ahh, I see. I didn't realise there were any advantages to using the headers.

Perhaps long argument support should be off by default, with an option
in the server's hgrc to turn it on? Then at least Mercurial would
continue working after the upgrade in this case.

>> Rejected approaches:
>> - Send the command arguments in the HTTP request header. This doesn't help
>>   much, because Apache by default has the same limit on URL size as it does
>>   for each header.
>
> I think the limit on each cookie is finite, but that there can be
> multiple cookies?

Yes. Apache, for example, allows 100 headers by default.

Potential issues with using the headers:
- Each web server would have a different header size, so it may be
necessary to provide this header size in the hgrc. Putting the
arguments in the body would require no configuration, except perhaps
the on/off flag mentioned above.
- There is still a limit to the amount of data we can put into the
headers, but no practical limit on the body size.

If the web servers in common use allow enough data in the headers, and
we can make a reasonable assumption about the minimum header size,
then these are non-issues. I'll need to do some research. Unless
anyone on the list already knows?


More information about the Mercurial-devel mailing list