Skip to content

Commit

Permalink
Merge branch 'jc/fetch-progressive-stride'
Browse files Browse the repository at this point in the history
* jc/fetch-progressive-stride:
  Fix potential local deadlock during fetch-pack
  • Loading branch information
Junio C Hamano committed Mar 29, 2011
2 parents 2eee139 + 44d8dc5 commit 96220d8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions builtin/fetch-pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 96220d8

Please sign in to comment.