summaryrefslogtreecommitdiff
path: root/builtin/fetch-pack.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2011-03-29 14:09:08 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2011-03-29 14:09:08 -0700
commit96220d837c4f58a6be447127b727b8a55246d231 (patch)
tree84629c70ffa3fef1718c415a2304748436dc1934 /builtin/fetch-pack.c
parentMerge branches 'sp/maint-fetch-pack-stop-early' and 'sp/maint-upload-pack-sto... (diff)
parentFix potential local deadlock during fetch-pack (diff)
downloadtgif-96220d837c4f58a6be447127b727b8a55246d231.tar.xz
Merge branch 'jc/fetch-progressive-stride'
* jc/fetch-progressive-stride: Fix potential local deadlock during fetch-pack
Diffstat (limited to 'builtin/fetch-pack.c')
-rw-r--r--builtin/fetch-pack.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c
index 65a8727453..85aff029b2 100644
--- a/builtin/fetch-pack.c
+++ b/builtin/fetch-pack.c
@@ -230,16 +230,17 @@ static void insert_alternate_refs(void)
}
#define INITIAL_FLUSH 16
+#define PIPESAFE_FLUSH 32
#define LARGE_FLUSH 1024
static int next_flush(int count)
{
- if (count < INITIAL_FLUSH * 2)
- count += INITIAL_FLUSH;
- else if (count < LARGE_FLUSH)
+ int flush_limit = args.stateless_rpc ? LARGE_FLUSH : PIPESAFE_FLUSH;
+
+ if (count < flush_limit)
count <<= 1;
else
- count += LARGE_FLUSH;
+ count += flush_limit;
return count;
}