[PATCH] httppeer: make sure we limit argument for older server not supporting batch

Pierre-Yves David pierre-yves.david at ens-lyon.org
Thu Apr 25 03:58:10 EDT 2019



On 4/25/19 6:03 AM, Martin von Zweigbergk wrote:
> 
> 
> On Wed, Apr 24, 2019 at 7:25 PM Gregory Szorc <gregory.szorc at gmail.com 
> <mailto:gregory.szorc at gmail.com>> wrote:
> 
>     On Wed, Apr 24, 2019 at 12:29 AM Pierre-Yves David
>     <pierre-yves.david at ens-lyon.org
>     <mailto:pierre-yves.david at ens-lyon.org>> wrote:
> 
>         # HG changeset patch
>         # User Pierre-Yves David <pierre-yves.david at octobus.net
>         <mailto:pierre-yves.david at octobus.net>>
>         # Date 1556049342 -7200
>         #      Tue Apr 23 21:55:42 2019 +0200
>         # Node ID 26f277f0f415206036a57f17400284107816f00d
>         # Parent  84bd6ae2d1f656dff1d494a03558c4edb58ebd31
>         # EXP-Topic discovery-followup
>         # Available At https://bitbucket.org/octobus/mercurial-devel/
>         #              hg pull
>         https://bitbucket.org/octobus/mercurial-devel/ -r 26f277f0f415
>         httppeer: make sure we limit argument for older server not
>         supporting batch
> 
> 
> I believe this patch was in response to a question from me. I was asking 
> if 'httppostargs' automatically upgraded the HTTP method from GET to 
> POST and I thought it did not and that we relied on the use of the 
> 'batch' request for that (which always used POST, I think). Joerg then 
> replied that 'httppostargs' does upgrade from GET to POST, so I think 
> this patch is not needed. Do you (both Greg and Pierre-Yves) agree?

Yes, I agree, it can be dropped, I sent it before I saw Joerg and Martin 
reply.

> 
> 
>     Queued.
> 
> 
>         Most commands will still have some argument restriction when
>         using 'GET' method
>         instead of batching through POST.
> 
>         diff --git a/mercurial/httppeer.py b/mercurial/httppeer.py
>         --- a/mercurial/httppeer.py
>         +++ b/mercurial/httppeer.py
>         @@ -382,7 +382,9 @@ class httppeer(wireprotov1peer.wirepeer)
>                   self._path = path
>                   self._url = url
>                   self._caps = caps
>         -        self.limitedarguments = caps is not None and
>         'httppostargs' not in caps
>         +        self.limitedarguments = False
>         +        if caps is None or 'batch' not in caps or
>         'httppostargs' not in caps:
>         +            self.limitedarguments = True
>                   self._urlopener = opener
>                   self._requestbuilder = requestbuilder
> 
>         _______________________________________________
>         Mercurial-devel mailing list
>         Mercurial-devel at mercurial-scm.org
>         <mailto:Mercurial-devel at mercurial-scm.org>
>         https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
> 
>     _______________________________________________
>     Mercurial-devel mailing list
>     Mercurial-devel at mercurial-scm.org
>     <mailto:Mercurial-devel at mercurial-scm.org>
>     https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
> 

-- 
Pierre-Yves David


More information about the Mercurial-devel mailing list