diff --git a/.idea/encodings.xml b/.idea/encodings.xml index a363e60..8f8d6ca 100644 --- a/.idea/encodings.xml +++ b/.idea/encodings.xml @@ -1,6 +1,6 @@ - + @@ -21,6 +21,7 @@ + @@ -29,17 +30,12 @@ - - - - - diff --git a/CMakeCfg.txt b/CMakeCfg.txt index b4bbbc5..49102d2 100644 --- a/CMakeCfg.txt +++ b/CMakeCfg.txt @@ -20,6 +20,8 @@ elseif ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") set(OS_POSIX 1) MESSAGE(STATUS "build on Linux...") # add_subdirectory(server/tp_web/src) + # set(CMAKE_CXX_STANDARD 11) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") set(TP_EXTERNAL_RELEASE_DIR "${PROJECT_SOURCE_DIR}/external/linux/release") elseif ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows") # MESSAGE(FATAL_ERROR "unsupported platform: Windows") diff --git a/common/libex/include/ex/ex_platform.h b/common/libex/include/ex/ex_platform.h index 6a23715..099cfbf 100644 --- a/common/libex/include/ex/ex_platform.h +++ b/common/libex/include/ex/ex_platform.h @@ -67,6 +67,7 @@ # include // O_RDONLY, etc. # include # include +# include # include # include # include diff --git a/common/libex/include/ex/ex_str.h b/common/libex/include/ex/ex_str.h index 330d8e8..4fc9ce4 100644 --- a/common/libex/include/ex/ex_str.h +++ b/common/libex/include/ex/ex_str.h @@ -55,7 +55,8 @@ int ex_wcsformat(wchar_t* out_buf, size_t buf_size, const wchar_t* fmt, ...); #include #include -#include +//#include +#include typedef std::string ex_astr; typedef std::wstring ex_wstr; diff --git a/server/tp_core/core/ts_http_rpc.cpp b/server/tp_core/core/ts_http_rpc.cpp index d9530ab..4340e1d 100644 --- a/server/tp_core/core/ts_http_rpc.cpp +++ b/server/tp_core/core/ts_http_rpc.cpp @@ -9,6 +9,7 @@ extern TppManager g_tpp_mgr; #include +#include #define HEXTOI(x) (isdigit(x) ? x - '0' : x - 'W') diff --git a/server/tp_core/protocol/ssh/ssh_session.cpp b/server/tp_core/protocol/ssh/ssh_session.cpp index 0585442..fddf9f9 100644 --- a/server/tp_core/protocol/ssh/ssh_session.cpp +++ b/server/tp_core/protocol/ssh/ssh_session.cpp @@ -464,8 +464,9 @@ int SshSession::_on_auth_password_request(ssh_session session, const char *user, if (_this->m_auth_type != TP_AUTH_TYPE_NONE) ssh_options_set(_this->m_srv_session, SSH_OPTIONS_USER, _this->m_acc_name.c_str()); - // default timeout is 10 seconds, it is too short for connect progress, so set it to 60 sec. - int _timeout = 60; // 60 sec. + // default timeout is 10 seconds, it is too short for connect progress, so set it to 120 sec. + // usually when sshd config to UseDNS. + int _timeout = 120; // 120 sec. ssh_options_set(_this->m_srv_session, SSH_OPTIONS_TIMEOUT, &_timeout); int rc = 0; @@ -478,13 +479,13 @@ int SshSession::_on_auth_password_request(ssh_session session, const char *user, } // once the server are connected, change the timeout back to default. - _timeout = 30; // in seconds. + _timeout = 120; // in seconds. ssh_options_set(_this->m_srv_session, SSH_OPTIONS_TIMEOUT, &_timeout); // get ssh version of host, v1 or v2 // TODO: libssh-0.8.5 does not support sshv1 anymore. _this->m_ssh_ver = ssh_get_version(_this->m_srv_session); - EXLOGW("[ssh] real host is SSHv%d\n", _this->m_ssh_ver); + //EXLOGW("[ssh] real host is SSHv%d\n", _this->m_ssh_ver); #if 0 // check supported auth type by host