Commits

Anonymous committed 96220d8 Merge

Merge branch 'jc/fetch-progressive-stride'

* jc/fetch-progressive-stride:
Fix potential local deadlock during fetch-pack

  • Participants
  • Parent commits 2eee139, 44d8dc5

Comments (0)

Files changed (1)

File builtin/fetch-pack.c

 }
 
 #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;
 }