TW-53436 fix one more hanging
authorDmitry Neverov <dmitry.neverov@gmail.com>
Wed, 24 Jan 2018 16:00:22 +0000 (17:00 +0100)
committerDmitry Neverov <dmitry.neverov@gmail.com>
Wed, 24 Jan 2018 16:00:22 +0000 (17:00 +0100)
Continue read data even if channel is closed. Remote side can close it
when all data were send, but not yet read by us.

git-agent/src/jetbrains/buildServer/buildTriggers/vcs/git/agent/JSchClient.java

index 8a437d7cf0fdb039c31c0759a30de85cab74a4a6..188082ca5524a2b7652858410b61fb276976ebd0 100644 (file)
@@ -178,7 +178,7 @@ public class JSchClient {
 
       byte[] buffer = new byte[BUF_SIZE];
       int count;
-      while (channel.isConnected() && !channel.isClosed() && (count = input.read(buffer)) != -1) {
+      while ((count = input.read(buffer)) != -1) {
         System.out.write(buffer, 0, count);
       }
     } finally {