Skip to content

Commit 8e9182e

Browse files
committed
enable "no-done" extension only when fetching over smart-http
When 'no-done' protocol extension is used, the upload-pack (i.e. the server side) process stops listening to the fetch-pack after issuing the final NAK, and starts sending the generated pack data back, but there may be more "have" send by the latter in flight that the fetch-pack is expecting to be responded with ACK/NAK. This will typically result in a deadlock (both will block on write that the other end never reads) or SIGPIPE on the fetch-pack end (upload-pack will finish writing a small pack and goes away). Disable it unless fetch-pack is running under smart-http, where there is no such streaming issue. Signed-off-by: Junio C Hamano <[email protected]> Acked-by: Shawn O. Pearce <[email protected]>
1 parent 761ecf0 commit 8e9182e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

builtin/fetch-pack.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,8 @@ static struct ref *do_fetch_pack(int fd[2],
708708
if (server_supports("no-done")) {
709709
if (args.verbose)
710710
fprintf(stderr, "Server supports no-done\n");
711-
no_done = 1;
711+
if (args.stateless_rpc)
712+
no_done = 1;
712713
}
713714
}
714715
else if (server_supports("multi_ack")) {

0 commit comments

Comments
 (0)