Terminate StreamCopy threads in case of errors
Bug: 513554 Change-Id: I065836b8fc77ade6de92e4a809fcf770a4f793ec Signed-off-by: Dmitry Neverov <dmitry.neverov@gmail.com>
This commit is contained in:
parent
2bbe15abd4
commit
a0a8a6a3e4
|
@ -220,6 +220,7 @@ private boolean isRunning() {
|
|||
public void destroy() {
|
||||
if (channel.isConnected())
|
||||
channel.disconnect();
|
||||
closeOutputStream();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -283,12 +283,12 @@ class SshFetchConnection extends BasePackFetchConnection {
|
|||
init(process.getInputStream(), process.getOutputStream());
|
||||
|
||||
} catch (TransportException err) {
|
||||
close();
|
||||
throw err;
|
||||
} catch (IOException err) {
|
||||
close();
|
||||
} catch (Throwable err) {
|
||||
throw new TransportException(uri,
|
||||
JGitText.get().remoteHungUpUnexpectedly, err);
|
||||
} finally {
|
||||
close();
|
||||
}
|
||||
|
||||
try {
|
||||
|
@ -341,12 +341,12 @@ class SshPushConnection extends BasePackPushConnection {
|
|||
init(process.getInputStream(), process.getOutputStream());
|
||||
|
||||
} catch (TransportException err) {
|
||||
close();
|
||||
throw err;
|
||||
} catch (IOException err) {
|
||||
close();
|
||||
} catch (Throwable err) {
|
||||
throw new TransportException(uri,
|
||||
JGitText.get().remoteHungUpUnexpectedly, err);
|
||||
} finally {
|
||||
close();
|
||||
}
|
||||
|
||||
try {
|
||||
|
|
Loading…
Reference in New Issue