summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
diff options
context:
space:
mode:
authorTerry Parker <tparker@google.com>2018-02-28 15:10:23 -0800
committerTerry Parker <tparker@google.com>2018-02-28 15:32:57 -0800
commit5a74b586b38271aa04c2b2b3451c03f0c586ba82 (patch)
tree39a635ee49e23b27814634eaed4644535ee78a16 /org.eclipse.jgit
parentc0bb992845e6ba5df9f420739fe9075ed20e9ee2 (diff)
downloadjgit-5a74b586b38271aa04c2b2b3451c03f0c586ba82.tar.gz
jgit-5a74b586b38271aa04c2b2b3451c03f0c586ba82.zip
Correctly exit fetch negotiation for stateless RPC connections
Commit 9530c10192cf033c021802a3b295b06864654464 (2018-02-11) "Add a minimum negotiation feature for fetch" made fetch negotiation cheaper for repos with huge numbers of references (we are seeing a 15x reduction in maximum fetch times for chromium/chromium/src on trans-Pacific links). But it inadvertently broke the handling of stateless RPC connections, so fix that here. Change-Id: I0090aa76ffecc55801ebb833ac2e0c933a4a7c54 Signed-off-by: Terry Parker <tparker@google.com>
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackFetchConnection.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackFetchConnection.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackFetchConnection.java
index c3888d5397..1383045031 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackFetchConnection.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackFetchConnection.java
@@ -634,6 +634,9 @@ public abstract class BasePackFetchConnection extends BasePackConnection
// Minimal negotiation was requested and we sent out our
// current reference values for our wants, so terminate
// negotiation early.
+ if (statelessRPC) {
+ state.writeTo(out, null);
+ }
break SEND_HAVES;
}
break READ_RESULT;
@@ -669,6 +672,9 @@ public abstract class BasePackFetchConnection extends BasePackConnection
if (minimalNegotiationSet != null && minimalNegotiationSet.isEmpty()) {
// Minimal negotiation was requested and we sent out our current reference
// values for our wants, so terminate negotiation early.
+ if (statelessRPC) {
+ state.writeTo(out, null);
+ }
break SEND_HAVES;
}
break;