]> git.ipfire.org Git - thirdparty/git.git/commit
t5551: test usage of chunked encoding explicitly
authorJonathan Tan <jonathantanmy@google.com>
Wed, 5 Jun 2019 19:26:24 +0000 (12:26 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 27 Jun 2019 17:14:10 +0000 (10:14 -0700)
commit8d45ad8c29dd509d1aefe9052124ef497c287476
treef6fc61ee7d125d4196dbeb0e8aa62222ccc595b4
parentaeb582a98374c094361cba1bd756dc6307432c42
t5551: test usage of chunked encoding explicitly

When run using GIT_TEST_PROTOCOL_VERSION=2, a test in t5551 fails
because 4 POSTs (probe, ls-refs, probe, fetch) are sent instead of 2
(probe, fetch).

One way to resolve this would be to relax the condition (from "= 2" to
greater than 1, say), but upon further inspection, the test probably
shouldn't be counting the number of POSTs. This test states that large
requests are split across POSTs, but this is not correct; the main
change is that chunked transfer encoding is used, but the request is
still contained within one POST. (The test coincidentally works because
Git indeed sends 2 POSTs in the case of a large request, but that is
because, as stated above, the first POST is a probing RPC - see
post_rpc() in remote-curl.c for more information.)

Therefore, instead of counting POSTs, check that chunked transfer
encoding is used. This also has the desirable side effect of passing
with GIT_TEST_PROTOCOL_VERSION=2.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Acked-by: Derrick Stolee <dstolee@microsoft.com>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t5551-http-fetch-smart.sh