From d69fb4d4ac7bcf7d0d84109bba56cf944646fb24 Mon Sep 17 00:00:00 2001 From: Thomas Wolf Date: Tue, 3 Nov 2020 23:33:19 +0100 Subject: Revert "Client-side protocol V2 support for fetching" This reverts commit f802f06e7fd5a98f256b7b7727598491f563bf2f. I had misunderstood how protocol V2 works. This implementation only works if the negotiation during fetch is done in one round. Fixing this is substantial work in BasePackFetchConnection. Basically I think I'd have to change back negotiate to the V0 version, and have a doFetch() that does if protocol V2 doFetchV2() else doFetchV0() with doFetchV0 the old code, and doFetchV2 completely new. Plus there would need to be a HTTP test case requiring several negotiation rounds. This is a couple of days work at least, and I don't know when I will have the time to revisit this. So although the rest of the code is fine I prefer to back this out completely and not leave a only half working implementation in the code for an indeterminate time. Bug: 553083 Change-Id: Icbbbb09882b3b83f9897deac4a06d5f8dc99d84e Signed-off-by: Thomas Wolf --- .../org/eclipse/jgit/transport/JschSession.java | 25 ++++------------------ 1 file changed, 4 insertions(+), 21 deletions(-) (limited to 'org.eclipse.jgit.ssh.jsch/src/org') diff --git a/org.eclipse.jgit.ssh.jsch/src/org/eclipse/jgit/transport/JschSession.java b/org.eclipse.jgit.ssh.jsch/src/org/eclipse/jgit/transport/JschSession.java index c7d0941b62..858bdf3f7f 100644 --- a/org.eclipse.jgit.ssh.jsch/src/org/eclipse/jgit/transport/JschSession.java +++ b/org.eclipse.jgit.ssh.jsch/src/org/eclipse/jgit/transport/JschSession.java @@ -22,9 +22,7 @@ import java.io.InputStream; import java.io.OutputStream; import java.util.ArrayList; import java.util.Collection; -import java.util.Collections; import java.util.List; -import java.util.Map; import java.util.concurrent.Callable; import java.util.concurrent.TimeUnit; @@ -46,7 +44,7 @@ import com.jcraft.jsch.SftpException; * {@link org.eclipse.jgit.transport.JschConfigSessionFactory} is used to create * the actual session passed to the constructor. */ -public class JschSession implements RemoteSession2 { +public class JschSession implements RemoteSession { final Session sock; final URIish uri; @@ -67,14 +65,7 @@ public class JschSession implements RemoteSession2 { /** {@inheritDoc} */ @Override public Process exec(String command, int timeout) throws IOException { - return exec(command, Collections.emptyMap(), timeout); - } - - /** {@inheritDoc} */ - @Override - public Process exec(String command, Map environment, - int timeout) throws IOException { - return new JschProcess(command, environment, timeout); + return new JschProcess(command, timeout); } /** {@inheritDoc} */ @@ -133,8 +124,6 @@ public class JschSession implements RemoteSession2 { * * @param commandName * the command to execute - * @param environment - * environment variables to pass on * @param tms * the timeout value, in seconds, for the command. * @throws TransportException @@ -143,17 +132,11 @@ public class JschSession implements RemoteSession2 { * @throws IOException * on problems opening streams */ - JschProcess(String commandName, Map environment, - int tms) throws TransportException, IOException { + JschProcess(String commandName, int tms) + throws TransportException, IOException { timeout = tms; try { channel = (ChannelExec) sock.openChannel("exec"); //$NON-NLS-1$ - if (environment != null) { - for (Map.Entry envVar : environment - .entrySet()) { - channel.setEnv(envVar.getKey(), envVar.getValue()); - } - } channel.setCommand(commandName); setupStreams(); channel.connect(timeout > 0 ? timeout * 1000 : 0); -- cgit v1.2.3