]> git.ipfire.org Git - thirdparty/git.git/commit - t/t5702-protocol-v2.sh
remote-curl: error on incomplete packet
authorDenton Liu <liu.denton@gmail.com>
Tue, 19 May 2020 10:53:58 +0000 (06:53 -0400)
committerJunio C Hamano <gitster@pobox.com>
Sun, 24 May 2020 23:26:00 +0000 (16:26 -0700)
commit74b082ad34fe2c727c676dac5c33d5e1e5f5ca56
tree22b53bf2d7dae28186452dfba44f5866d81f3b4e
parent101736a14c9ad734fe24efed7513189849cd22eb
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 <peff@peff.net>
Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
remote-curl.c
t/lib-httpd.sh
t/lib-httpd/apache.conf
t/lib-httpd/incomplete-body-upload-pack-v2-http.sh [new file with mode: 0644]
t/lib-httpd/incomplete-length-upload-pack-v2-http.sh [new file with mode: 0644]
t/t5702-protocol-v2.sh