]> Pileus Git - ~andy/git/blobdiff - builtin/fetch-pack.c
fetch-pack: use smaller handshake window for initial request
[~andy/git] / builtin / fetch-pack.c
index b4f34a2cf93a8e0579ea183b644f558807df47e5..3c2c9406c499102138495638d98797886855c073 100644 (file)
@@ -218,12 +218,14 @@ static void send_request(int fd, struct strbuf *buf)
                safe_write(fd, buf->buf, buf->len);
 }
 
-#define INITIAL_FLUSH 32
+#define INITIAL_FLUSH 16
 #define LARGE_FLUSH 1024
 
 static int next_flush(int count)
 {
-       if (count < LARGE_FLUSH)
+       if (count < INITIAL_FLUSH * 2)
+               count += INITIAL_FLUSH;
+       else if (count < LARGE_FLUSH)
                count <<= 1;
        else
                count += LARGE_FLUSH;