Browse Source

Terminate StreamCopy threads in case of errors

Bug: 513554
Change-Id: I065836b8fc77ade6de92e4a809fcf770a4f793ec
Signed-off-by: Dmitry Neverov <dmitry.neverov@gmail.com>
stable-4.9
Dmitry Neverov 8 years ago committed by David Pursehouse
parent
commit
a0a8a6a3e4
  1. 1
      org.eclipse.jgit/src/org/eclipse/jgit/transport/JschSession.java
  2. 12
      org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportGitSsh.java

1
org.eclipse.jgit/src/org/eclipse/jgit/transport/JschSession.java

@ -220,6 +220,7 @@ public class JschSession implements RemoteSession {
public void destroy() { public void destroy() {
if (channel.isConnected()) if (channel.isConnected())
channel.disconnect(); channel.disconnect();
closeOutputStream();
} }
@Override @Override

12
org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportGitSsh.java

@ -283,12 +283,12 @@ public class TransportGitSsh extends SshTransport implements PackTransport {
init(process.getInputStream(), process.getOutputStream()); init(process.getInputStream(), process.getOutputStream());
} catch (TransportException err) { } catch (TransportException err) {
close();
throw err; throw err;
} catch (IOException err) { } catch (Throwable err) {
close();
throw new TransportException(uri, throw new TransportException(uri,
JGitText.get().remoteHungUpUnexpectedly, err); JGitText.get().remoteHungUpUnexpectedly, err);
} finally {
close();
} }
try { try {
@ -341,12 +341,12 @@ public class TransportGitSsh extends SshTransport implements PackTransport {
init(process.getInputStream(), process.getOutputStream()); init(process.getInputStream(), process.getOutputStream());
} catch (TransportException err) { } catch (TransportException err) {
close();
throw err; throw err;
} catch (IOException err) { } catch (Throwable err) {
close();
throw new TransportException(uri, throw new TransportException(uri,
JGitText.get().remoteHungUpUnexpectedly, err); JGitText.get().remoteHungUpUnexpectedly, err);
} finally {
close();
} }
try { try {

Loading…
Cancel
Save