remote-curl: remove spurious period
[gitweb.git] / fetch-pack.c
index b501d5c320a5117020a934a50fce2a356b0c2f0e..413937e7404d163883d5d0456ebefc4e1504cd87 100644 (file)
@@ -243,16 +243,21 @@ static void insert_one_alternate_ref(const struct ref *ref, void *unused)
 
 #define INITIAL_FLUSH 16
 #define PIPESAFE_FLUSH 32
-#define LARGE_FLUSH 1024
+#define LARGE_FLUSH 16384
 
 static int next_flush(struct fetch_pack_args *args, int count)
 {
-       int flush_limit = args->stateless_rpc ? LARGE_FLUSH : PIPESAFE_FLUSH;
-
-       if (count < flush_limit)
-               count <<= 1;
-       else
-               count += flush_limit;
+       if (args->stateless_rpc) {
+               if (count < LARGE_FLUSH)
+                       count <<= 1;
+               else
+                       count = count * 11 / 10;
+       } else {
+               if (count < PIPESAFE_FLUSH)
+                       count <<= 1;
+               else
+                       count += PIPESAFE_FLUSH;
+       }
        return count;
 }
 
@@ -423,10 +428,17 @@ static int find_common(struct fetch_pack_args *args,
                                                const char *hex = sha1_to_hex(result_sha1);
                                                packet_buf_write(&req_buf, "have %s\n", hex);
                                                state_len = req_buf.len;
-                                       }
+                                               /*
+                                                * Reset in_vain because an ack
+                                                * for this commit has not been
+                                                * seen.
+                                                */
+                                               in_vain = 0;
+                                       } else if (!args->stateless_rpc
+                                                  || ack != ACK_common)
+                                               in_vain = 0;
                                        mark_common(commit, 0, 1);
                                        retval = 0;
-                                       in_vain = 0;
                                        got_continue = 1;
                                        if (ack == ACK_ready) {
                                                clear_prio_queue(&rev_list);