Issue 636: disable stderr parsing until we determine cause of hanging

This commit is contained in:
Adrian Cole 2011-07-24 17:42:30 -07:00
parent a604d25477
commit efa574c175

View File

@ -417,7 +417,6 @@ public class JschSshClient implements SshClient {
executor = acquire(execConnection(command)); executor = acquire(execConnection(command));
try { try {
String outputString = Strings2.toStringAndClose(executor.getInputStream()); String outputString = Strings2.toStringAndClose(executor.getInputStream());
String errorString = Strings2.toStringAndClose(executor.getErrStream());
int errorStatus = executor.getExitStatus(); int errorStatus = executor.getExitStatus();
int i = 0; int i = 0;
String message = String.format("bad status -1 %s", toString()); String message = String.format("bad status -1 %s", toString());
@ -427,6 +426,12 @@ public class JschSshClient implements SshClient {
} }
if (errorStatus == -1) if (errorStatus == -1)
throw new SshException(message); throw new SshException(message);
// be careful as this can hang reading
// com.jcraft.jsch.Channel$MyPipedInputStream when there's a slow
// network connection
// String errorString =
// Strings2.toStringAndClose(executor.getErrStream());
String errorString = "";
return new ExecResponse(outputString, errorString, errorStatus); return new ExecResponse(outputString, errorString, errorStatus);
} finally { } finally {
if (executor != null) if (executor != null)