Browse Source

Correctly exit fetch negotiation for stateless RPC connections

Commit 9530c10192 (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>
stable-4.11
Terry Parker 7 years ago
parent
commit
5a74b586b3
  1. 6
      org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackFetchConnection.java

6
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 // Minimal negotiation was requested and we sent out our
// current reference values for our wants, so terminate // current reference values for our wants, so terminate
// negotiation early. // negotiation early.
if (statelessRPC) {
state.writeTo(out, null);
}
break SEND_HAVES; break SEND_HAVES;
} }
break READ_RESULT; break READ_RESULT;
@ -669,6 +672,9 @@ public abstract class BasePackFetchConnection extends BasePackConnection
if (minimalNegotiationSet != null && minimalNegotiationSet.isEmpty()) { if (minimalNegotiationSet != null && minimalNegotiationSet.isEmpty()) {
// Minimal negotiation was requested and we sent out our current reference // Minimal negotiation was requested and we sent out our current reference
// values for our wants, so terminate negotiation early. // values for our wants, so terminate negotiation early.
if (statelessRPC) {
state.writeTo(out, null);
}
break SEND_HAVES; break SEND_HAVES;
} }
break; break;

Loading…
Cancel
Save