airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shame...@apache.org
Subject [4/5] airavata git commit: Try to read input stream first time and then read until jsh channel is closed.
Date Sun, 10 May 2015 20:41:12 GMT
Try to read input stream first time and then read until jsh channel is closed.


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/4de74c60
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/4de74c60
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/4de74c60

Branch: refs/heads/master
Commit: 4de74c6017ad2b6c3554a4956a4fd9db216ad2d3
Parents: fd6e0a0
Author: shamrath <shameerainfo@gmail.com>
Authored: Sun May 10 16:39:57 2015 -0400
Committer: shamrath <shameerainfo@gmail.com>
Committed: Sun May 10 16:39:57 2015 -0400

----------------------------------------------------------------------
 .../java/org/apache/airavata/gsi/ssh/impl/StandardOutReader.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/4de74c60/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/StandardOutReader.java
----------------------------------------------------------------------
diff --git a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/StandardOutReader.java
b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/StandardOutReader.java
index 767fc61..9f5fa4c 100644
--- a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/StandardOutReader.java
+++ b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/StandardOutReader.java
@@ -42,13 +42,13 @@ public class StandardOutReader implements CommandOutput {
             StringBuffer pbsOutput = new StringBuffer("");
             InputStream inputStream =  channel.getInputStream();
             byte[] tmp = new byte[1024];
-            while (!channel.isClosed()) {
+            do {
                 while (inputStream.available() > 0) {
                     int i = inputStream.read(tmp, 0, 1024);
                     if (i < 0) break;
                     pbsOutput.append(new String(tmp, 0, i));
                 }
-            }
+            } while (!channel.isClosed()) ;
             String output = pbsOutput.toString();
             this.setStdOutputString(output);
         } catch (IOException e) {


Mime
View raw message