Core/SSH: Z compression is enabled. (uses plugin/z on WIN32)

Core/SSH: A CLANG warning (-Wimplicit-function-declaration) condition for gettimeofday() function is fixed. 
Core/SSH: Cleanup, small bugfixes and cosmetics..
Core/SSH: API docs are updated accordingly.

git-svn-id: svn://ultimatepp.org/upp/trunk@14509 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
oblivion 2020-05-28 13:22:30 +00:00
parent 28bd91841a
commit 810ea1ec95
13 changed files with 119 additions and 83 deletions

View file

@ -24,16 +24,19 @@ public:
public:
SshSession& Timeout(int ms) { ssh->timeout = ms; return *this; }
SshSession& Compression(bool b = true) { session->compression = b; return *this; }
SshSession& NoCompression() { return Compression(false); }
SshSession& Keys(const String& prikey, const String& pubkey, const String& phrase, bool fromfile = true);
SshSession& Method(int type, Value method) { session->iomethods(type) << pick(method); return *this; }
SshSession& Methods(ValueMap methods) { session->iomethods = pick(methods); return *this; }
SshSession& PasswordAuth() { session->authmethod = PASSWORD; return *this; }
SshSession& PublicKeyAuth() { session->authmethod = PUBLICKEY; return *this; }
SshSession& HostBasedAuth() { session->authmethod = HOSTBASED; return *this; }
SshSession& KeyboardAuth() { session->authmethod = KEYBOARD; return *this; }
SshSession& AgentAuth() { session->authmethod = SSHAGENT; return *this; }
LIBSSH2_SESSION* GetHandle() { return ssh->session; }
String GetBanner() const { return ssh->session ? pick(String(libssh2_session_banner_get(ssh->session))) : Null; }
@ -93,6 +96,7 @@ private:
String phrase;
ValueMap iomethods;
bool connected;
bool compression;
};
One<SessionData> session;