diff --git a/server/tp_core/core/ts_env.cpp b/server/tp_core/core/ts_env.cpp index 607cae1..82e069a 100644 --- a/server/tp_core/core/ts_env.cpp +++ b/server/tp_core/core/ts_env.cpp @@ -49,24 +49,6 @@ bool TsEnv::init(bool load_config) } else // not in development mode { -// #ifdef EX_OS_WIN32 -// base_path = m_exec_path; -// ex_path_join(base_path, true, L"..", NULL); -// m_etc_path = base_path; -// ex_path_join(m_etc_path, false, L"etc", NULL); -// conf_file = m_etc_path; -// ex_path_join(conf_file, false, L"core.ini", NULL); -// m_replay_path = base_path; -// ex_path_join(m_replay_path, false, L"data", L"replay", NULL); -// log_path = base_path; -// ex_path_join(log_path, false, L"log", NULL); -// #else -// m_etc_path = L"/etc/teleport"; -// conf_file = L"/etc/teleport/core.ini"; -// m_replay_path = L"/var/lib/teleport/replay"; -// log_path = L"/var/log/teleport"; -// #endif - base_path = m_exec_path; ex_path_join(base_path, true, L"..", L"data", NULL); m_etc_path = base_path; @@ -79,8 +61,6 @@ bool TsEnv::init(bool load_config) ex_path_join(log_path, false, L"log", NULL); } - //EXLOGW(L"[core] load config file: %ls.\n", conf_file.c_str()); - if (!m_ini.LoadFromFile(conf_file)) { EXLOGE(L"[core] can not load %ls.\n", conf_file.c_str()); diff --git a/server/tp_core/core/ts_http_rpc.cpp b/server/tp_core/core/ts_http_rpc.cpp index ad0257e..337a008 100644 --- a/server/tp_core/core/ts_http_rpc.cpp +++ b/server/tp_core/core/ts_http_rpc.cpp @@ -55,7 +55,7 @@ TsHttpRpc::~TsHttpRpc() void TsHttpRpc::_thread_loop(void) { - EXLOGV("[core] rpc TeleportServer-HTTP-RPC ready on %s:%d\n", m_host_ip.c_str(), m_host_port); + EXLOGV("[core] TeleportServer-RPC ready on %s:%d\n", m_host_ip.c_str(), m_host_port); while(!m_stop_flag) { @@ -127,7 +127,7 @@ void TsHttpRpc::_mg_event_handler(struct mg_connection *nc, int ev, void *ev_dat ex_astr uri; uri.assign(hm->uri.p, hm->uri.len); - EXLOGD("[core] rpc got request: %s\n", uri.c_str()); + //EXLOGD("[core] rpc got request: %s\n", uri.c_str()); if (uri == "/rpc") { @@ -151,9 +151,7 @@ void TsHttpRpc::_mg_event_handler(struct mg_connection *nc, int ev, void *ev_dat EXLOGE("[core] rpc got invalid request: not `rpc` uri.\n"); _this->_create_json_ret(ret_buf, TSR_INVALID_REQUEST, "not a `rpc` request."); } - - - + mg_printf(nc, "HTTP/1.0 200 OK\r\nAccess-Control-Allow-Origin: *\r\nContent-Length: %d\r\nContent-Type: application/json\r\n\r\n%s", (int)ret_buf.size() - 1, &ret_buf[0]); nc->flags |= MG_F_SEND_AND_CLOSE; } diff --git a/server/tp_core/protocol/ssh/tpp_env.cpp b/server/tp_core/protocol/ssh/tpp_env.cpp index 44551e8..7a03179 100644 --- a/server/tp_core/protocol/ssh/tpp_env.cpp +++ b/server/tp_core/protocol/ssh/tpp_env.cpp @@ -29,7 +29,5 @@ bool TppSshEnv::_on_init(TPP_INIT_ARGS* args) { bind_port = TS_SSH_PROXY_PORT; } - EXLOGW(L"[ssh] listen on %s:%d\n", bind_ip.c_str(), bind_port); - return true; }