diff options
author | Shawn Pearce <spearce@spearce.org> | 2016-07-05 12:37:26 -0700 |
---|---|---|
committer | Shawn Pearce <spearce@spearce.org> | 2016-07-05 12:37:26 -0700 |
commit | 306932c7014c4058d744dab71d3c190e4a4bd926 (patch) | |
tree | fe985a9f7addc3c5119d24adb6256f1eef269862 /org.eclipse.jgit | |
parent | 60ca93798ccb780ed02df1db12b9ce75bdbb9925 (diff) | |
download | jgit-306932c7014c4058d744dab71d3c190e4a4bd926.tar.gz jgit-306932c7014c4058d744dab71d3c190e4a4bd926.zip |
ReceivePack: enable capabilities immediately on first line
Instead of deferring until after command parsing, enable the
capabilities after the first pkt-line has been read from the client.
This allows the server to setup the side-band-64k channel immediately.
Change-Id: I141b7fc92e983a41d3a58da8e1464a6917422b6c
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseReceivePack.java | 8 | ||||
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceivePack.java | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseReceivePack.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseReceivePack.java index c4f662be9d..6df2a4c6f6 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseReceivePack.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseReceivePack.java @@ -1077,7 +1077,7 @@ public abstract class BaseReceivePack { */ protected void recvCommands() throws IOException { PushCertificateParser certParser = getPushCertificateParser(); - FirstLine firstLine = null; + boolean firstPkt = true; try { for (;;) { String line; @@ -1097,10 +1097,12 @@ public abstract class BaseReceivePack { continue; } - if (firstLine == null) { - firstLine = new FirstLine(line); + if (firstPkt) { + firstPkt = false; + FirstLine firstLine = new FirstLine(line); enabledCapabilities = firstLine.getCapabilities(); line = firstLine.getLine(); + enableCapabilities(); if (line.equals(GitProtocolConstants.OPTION_PUSH_CERT)) { certParser.receiveHeader(pckIn, !isBiDirectionalPipe()); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceivePack.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceivePack.java index 1dd58d0d76..2477806bd9 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceivePack.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceivePack.java @@ -184,8 +184,6 @@ public class ReceivePack extends BaseReceivePack { return; recvCommands(); if (hasCommands()) { - enableCapabilities(); - Throwable unpackError = null; if (needPack()) { try { |