]> source.dussan.org Git - jgit.git/commitdiff
Do not requeue state vector in stateless RPC fetch 15/4315/1
authorShawn O. Pearce <spearce@spearce.org>
Wed, 14 Sep 2011 17:53:14 +0000 (10:53 -0700)
committerShawn O. Pearce <spearce@spearce.org>
Wed, 14 Sep 2011 22:34:55 +0000 (15:34 -0700)
If the no-done capability was enabled on the connection, don't
queue up the state vector again once the ACK %s ready message
is observed from the remote. The pack will be following in this
response stream, so the state vector is no longer required.

Change-Id: I7bd1e76957cb58c7ff1cdaeef227f1b02a7e5d24
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackFetchConnection.java

index 2c9761a257a59705bcd555cb2d5481d7c09ae57d..4a86da7c6d6896ded4f4bdb2b4f3d0337a87a1ce 100644 (file)
@@ -455,7 +455,7 @@ public abstract class BasePackFetchConnection extends BasePackConnection
                        state.writeTo(out, null);
 
                negotiateBegin();
-               SEND_HAVES: while (!receivedReady) {
+               SEND_HAVES: for (;;) {
                        final RevCommit c = walk.next();
                        if (c == null)
                                break SEND_HAVES;
@@ -530,6 +530,8 @@ public abstract class BasePackFetchConnection extends BasePackConnection
                                        throw new CancelledException();
                        }
 
+                       if (noDone & receivedReady)
+                               break SEND_HAVES;
                        if (statelessRPC)
                                state.writeTo(out, null);