From 7adbdd97bccaf36a0f7862548ef0b8116903de8f Mon Sep 17 00:00:00 2001 From: azw Date: Thu, 13 Apr 2023 23:05:49 +0000 Subject: [PATCH] 1 --- server/wsproxy/mastermgr.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/server/wsproxy/mastermgr.cc b/server/wsproxy/mastermgr.cc index 15e8259..eef6b93 100644 --- a/server/wsproxy/mastermgr.cc +++ b/server/wsproxy/mastermgr.cc @@ -20,6 +20,7 @@ class RequestTarget { public: long long context_id = 0; + int socket_handle = 0; std::string account_id; f8::MsgHdr* hdr_copy = nullptr; f8::TimerWp timer_wp; @@ -60,14 +61,14 @@ void MasterMgr::_SS_MS_ResponseTargetServer(f8::MsgHdr& hdr, const ss::SS_MS_Res msg.port() ); if (conn) { - RemoveRequest(req->hdr_copy->socket_handle); + RemoveRequest(req->socket_handle); conn->ForwardClientMsgEx(req->hdr_copy); return; } else { abort(); } } - RemoveRequest(req->hdr_copy->socket_handle); + RemoveRequest(req->socket_handle); } } @@ -107,6 +108,7 @@ void MasterMgr::RequestTargetServer(f8::MsgHdr& hdr, ++curr_context_id_; auto req = std::make_shared(); req->context_id = curr_context_id_; + req->socket_handle = hdr.socket_handle; req->hdr_copy = hdr.Clone(); ss::SS_WSP_RequestTargetServer msg; @@ -128,13 +130,13 @@ void MasterMgr::RequestTargetServer(f8::MsgHdr& hdr, if (a8::TIMER_EXEC_EVENT == event) { MasterMgr::Instance()->RemoveRequest ( - req->hdr_copy->socket_handle + req->socket_handle ); long long req_handle_time = a8::XGetTickCount() - req->req_tick; if (req_handle_time > App::Instance()->perf.max_login_time) { App::Instance()->perf.max_login_time = req_handle_time; } - DownStreamMgr::Instance()->AddPendingAccount(req->account_id, req->hdr_copy->socket_handle, req->req_tick); + DownStreamMgr::Instance()->AddPendingAccount(req->account_id, req->socket_handle, req->req_tick); } } );