解决某些情况下ssh远程连接卡住的问题(已经在Win上测试通过)。

pull/32/head
Apex Liu 2017-05-30 05:04:27 +08:00
parent f861da6d66
commit 0314268926
3 changed files with 1196 additions and 1224 deletions

View File

@ -29,7 +29,6 @@ bool SshProxy::init(void)
m_host_ip = g_ssh_env.bind_ip;
m_host_port = g_ssh_env.bind_port;
m_bind = ssh_bind_new();
if (NULL == m_bind)
{
@ -106,6 +105,10 @@ void SshProxy::_run(void)
{
// 注意ssh_new()出来的指针如果遇到停止标志本函数内部就释放了否则这个指针交给了SshSession类实例管理其析构时会释放。
ssh_session sess_to_client = ssh_new();
#ifdef EX_DEBUG
int flag = SSH_LOG_FUNCTIONS;
ssh_options_set(sess_to_client, SSH_OPTIONS_LOG_VERBOSITY, &flag);
#endif
struct sockaddr_storage sock_client;
char ip[32] = { 0 };

File diff suppressed because it is too large Load Diff

View File

@ -6,6 +6,8 @@ TPP_API ex_rv tpp_init(TPP_INIT_ARGS* init_args)
#ifdef EX_OS_UNIX
ssh_threads_set_callbacks(ssh_threads_get_pthread());
ssh_init();
#else
ssh_init();
#endif
if (!g_ssh_env.init(init_args))