diff options
-rw-r--r-- | builtin/fetch-pack.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c index 3c2c9406c4..147d67dca4 100644 --- a/builtin/fetch-pack.c +++ b/builtin/fetch-pack.c @@ -219,16 +219,17 @@ static void send_request(int fd, struct strbuf *buf) } #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; } |