Git Mailing List Archive on lore.kernel.org
 help / color / Atom feed
* Re: [PATCH v3] http-backend: allow empty CONTENT_LENGTH
  2018-09-10 20:36     ` Max Kirillov
@ 2018-09-11  4:06 Jonathan Nieder
  2018-09-11 20:33 ` [PATCH v2] http-backend test: make empty CONTENT_LENGTH test more realistic Max Kirillov
  -1 siblings, 1 reply; 36+ messages in thread
From: Jonathan Nieder @ 2018-09-11  4:06 UTC (permalink / raw)
  To: Max Kirillov; +Cc: Jelmer Vernooij, git, Jeff King

Max Kirillov wrote:
> On Sun, Sep 09, 2018 at 10:17:48PM -0700, Jonathan Nieder wrote:

>> From: Max Kirillov <max@max630.net>
>> Subject: http-backend test: make empty CONTENT_LENGTH test more realistic
>
> Thank you, yes, this is what should have left

Oh, tying up this loose end: do you know why the test passes without
574c513e8d (http-backend: allow empty CONTENT_LENGTH, 2018-09-10)?

^ permalink raw reply	[flat|nested] 36+ messages in thread
* Re: [PATCH v2] http-backend: allow empty CONTENT_LENGTH
  2018-09-07  3:36   ` [PATCH v2] " Max Kirillov
@ 2018-09-08  0:19 Jonathan Nieder
  2018-09-08  5:35 ` Max Kirillov
  2018-09-08  5:42 ` [PATCH v3] " Max Kirillov
  0 siblings, 2 replies; 36+ messages in thread
From: Jonathan Nieder @ 2018-09-08  0:19 UTC (permalink / raw)
  To: Max Kirillov; +Cc: Jelmer Vernooij, git, Jeff King

Hi,

Max Kirillov wrote:

> According to RFC3875, empty environment variable is equivalent to unset,
> and for CONTENT_LENGTH it should mean zero body to read.
>
> However, unset CONTENT_LENGTH is also used for chunked encoding to indicate
> reading until EOF. At least, the test "large fetch-pack requests can be split
> across POSTs" from t5551 starts faliing, if unset or empty CONTENT_LENGTH is
> treated as zero length body. So keep the existing behavior as much as possible.
>
> Add a test for the case.
>
> Reported-By: Jelmer Vernooij <jelmer@jelmer.uk>
> Signed-off-by: Max Kirillov <max@max630.net>
> ---
> Added the "reported-by" and explained inline the reason to keep existing behavior

Lovely, thanks.

To me, "keep the existing behavior as much as possible" isn't comforting
because it doesn't tell me *which* existing behavior.  Fortunately the patch
itself is comforting: it makes us treat "" the same way as unset, which is
exactly what the RFC requires.

So I'm happy with this version.  Thanks for your patient work.

Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>

^ permalink raw reply	[flat|nested] 36+ messages in thread
* Re: CONTENT_LENGTH can no longer be empty
@ 2018-09-06  6:10 Jonathan Nieder
  2018-09-06 19:35 ` [PATCH] http-backend: allow empty CONTENT_LENGTH Max Kirillov
  0 siblings, 1 reply; 36+ messages in thread
From: Jonathan Nieder @ 2018-09-06  6:10 UTC (permalink / raw)
  To: Jelmer Vernooij; +Cc: git, Max Kirillov

Hi,

Jelmer Vernooij wrote[1]:

> Git's http-backend has become slightly stricter about the content
> of the CONTENT_LENGTH variable. Previously, Dulwich would leave this
> variable empty but git now expects it to be set to 0 for GET requests
> without a body.
>
> I'm uploading a fixed version of dulwich.

Thanks for tracking it down!  This is likely due to v2.19.0-rc0~45^2~2
(http-backend: respect CONTENT_LENGTH as specified by rfc3875,
2018-06-10).

Max, RFC 3875 appears to allow a CONTENT_LENGTH of "" when no data is
attached to the request.  Should we check for this case (e.g. inserting
a *str check in

	if (str && !git_parse_ssize_t(str, &val))
		die("failed to parse CONTENT_LENGTH: %s", str);

?

Thanks,
Jonathan

[1] https://bugs.debian.org/907587

^ permalink raw reply	[flat|nested] 36+ messages in thread

end of thread, back to index

Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-11  4:06 [PATCH v3] http-backend: allow empty CONTENT_LENGTH Jonathan Nieder
2018-09-11 20:33 ` [PATCH v2] http-backend test: make empty CONTENT_LENGTH test more realistic Max Kirillov
  -- strict thread matches above, loose matches on Subject: below --
2018-09-08  0:19 [PATCH v2] http-backend: allow empty CONTENT_LENGTH Jonathan Nieder
2018-09-08  5:35 ` Max Kirillov
2018-09-08  5:42 ` [PATCH v3] " Max Kirillov
2018-09-10  5:17   ` Jonathan Nieder
2018-09-10 20:36     ` Max Kirillov
2018-09-06  6:10 CONTENT_LENGTH can no longer be empty Jonathan Nieder
2018-09-06 19:35 ` [PATCH] http-backend: allow empty CONTENT_LENGTH Max Kirillov
2018-09-06 21:54   ` Junio C Hamano
2018-09-07  3:27     ` Max Kirillov
2018-09-07  3:38       ` Jeff King
2018-09-07  4:20         ` Max Kirillov
2018-09-07  4:59         ` Max Kirillov
2018-09-07  9:49           ` Junio C Hamano
2018-09-08  5:41             ` Max Kirillov
2018-09-09  4:40             ` Max Kirillov
2018-09-06 22:45   ` Jonathan Nieder
2018-09-07  3:36   ` [PATCH v2] " Max Kirillov
2018-09-09  4:10     ` [PATCH v4] " Max Kirillov
2018-09-10  5:25       ` Jonathan Nieder
2018-09-10 13:17         ` Jeff King
2018-09-10 16:37           ` Junio C Hamano
2018-09-10 18:46             ` Jeff King
2018-09-10 20:53         ` [PATCH] http-backend: Treat empty CONTENT_LENGTH as zero Max Kirillov
2018-09-10 21:22           ` Jonathan Nieder
2018-09-11  1:55             ` Jeff King
2018-09-11  2:20               ` Jonathan Nieder
2018-09-11  2:30                 ` Jeff King
2018-09-11  1:58           ` Jeff King
2018-09-11  3:42           ` [PATCH] http-backend: treat " Jonathan Nieder
2018-09-11  4:03             ` Jonathan Nieder
2018-09-11 18:15               ` Junio C Hamano
2018-09-11 18:27                 ` Junio C Hamano
2018-09-12  5:56                 ` Jeff King
2018-09-12  6:26                   ` Jonathan Nieder
2018-09-12 16:10                   ` Junio C Hamano
2018-09-11  4:18             ` Junio C Hamano
2018-09-11  4:29               ` Jonathan Nieder

Git Mailing List Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/git/0 git/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 git git/ https://lore.kernel.org/git \
		git@vger.kernel.org
	public-inbox-index git

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.git


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git