ultimatepp/uppsrc/Core/SSH/Exec.cpp
oblivion bbc2096e95 SSH: SshChannel and SshExec classes are refactored, and re-added to the package. Cosmetics & various cleanup.
git-svn-id: svn://ultimatepp.org/upp/trunk@12164 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2018-08-12 19:36:30 +00:00

19 lines
337 B
C++

#include "SSH.h"
namespace Upp {
int SshExec::Execute(const String& cmd, String& out, String& err)
{
if(RequestExec(cmd)) {
int size = max(ssh->chunk_size, 1024);
out = Get(size);
err = GetStdErr(size);
if(!IsError() &&
PutGetEof() &&
Close() &&
WaitClose())
return GetExitCode();
}
return GetError();
}
}