enable "no-done" extension only when serving over smart-http
Do not advertise no-done capability when upload-pack is not serving over smart-http, as there is no way for this server to know when it should stop reading in-flight data from the client, even though it is necessary to drain all the in-flight data in order to unblock the client. Signed-off-by: Junio C Hamano <gitster@pobox.com> Acked-by: Shawn O. Pearce <spearce@spearce.org>
Junio C Hamano committed
Mar 29, 2011 at 10:24 UTC
cf2ad8e64175bcf4b2bb693a9e4c0a89076111dd
1 file changed
+4
-3
upload-pack.c
+4
-3
@@ -640,15 +640,16 @@ static int send_ref(const char *refname, const unsigned char *sha1, int flag, vo
640
{
641
static const char *capabilities = "multi_ack thin-pack side-band"
642
" side-band-64k ofs-delta shallow no-progress"
643
- " include-tag multi_ack_detailed no-done";
643
+ " include-tag multi_ack_detailed";
644
struct object *o = parse_object(sha1);
645
646
if (!o)
647
die("git upload-pack: cannot find object %s:", sha1_to_hex(sha1));
648
649
if (capabilities)
650
- packet_write(1, "%s %s%c%s\n", sha1_to_hex(sha1), refname,
651
- 0, capabilities);
650
+ packet_write(1, "%s %s%c%s%s\n", sha1_to_hex(sha1), refname,
651
+ 0, capabilities,
652
+ stateless_rpc ? " no-done" : "");
653
else
654
packet_write(1, "%s %s\n", sha1_to_hex(sha1), refname);
655
capabilities = NULL;