From 74b082ad34fe2c727c676dac5c33d5e1e5f5ca56 Mon Sep 17 00:00:00 2001 From: Denton Liu Date: Tue, 19 May 2020 06:53:58 -0400 Subject: remote-curl: error on incomplete packet Currently, remote-curl acts as a proxy and blindly forwards packets between an HTTP server and fetch-pack. In the case of a stateless RPC connection where the connection is terminated with a partially written packet, remote-curl will blindly send the partially written packet before waiting on more input from fetch-pack. Meanwhile, fetch-pack will read the partial packet and continue reading, expecting more input. This results in a deadlock between the two processes. For a stateless connection, inspect packets before sending them and error out if a packet line packet is incomplete. Helped-by: Jeff King Signed-off-by: Denton Liu Signed-off-by: Junio C Hamano --- t/lib-httpd/incomplete-length-upload-pack-v2-http.sh | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 t/lib-httpd/incomplete-length-upload-pack-v2-http.sh (limited to 't/lib-httpd/incomplete-length-upload-pack-v2-http.sh') diff --git a/t/lib-httpd/incomplete-length-upload-pack-v2-http.sh b/t/lib-httpd/incomplete-length-upload-pack-v2-http.sh new file mode 100644 index 0000000000..dce552e348 --- /dev/null +++ b/t/lib-httpd/incomplete-length-upload-pack-v2-http.sh @@ -0,0 +1,3 @@ +printf "Content-Type: text/%s\n" "application/x-git-upload-pack-result" +echo +printf "%s" "00" -- cgit v1.2.3