This commit is contained in:
azw 2023-04-13 23:05:49 +00:00
parent 452f337b9f
commit 7adbdd97bc

View File

@ -20,6 +20,7 @@ class RequestTarget
{ {
public: public:
long long context_id = 0; long long context_id = 0;
int socket_handle = 0;
std::string account_id; std::string account_id;
f8::MsgHdr* hdr_copy = nullptr; f8::MsgHdr* hdr_copy = nullptr;
f8::TimerWp timer_wp; f8::TimerWp timer_wp;
@ -60,14 +61,14 @@ void MasterMgr::_SS_MS_ResponseTargetServer(f8::MsgHdr& hdr, const ss::SS_MS_Res
msg.port() msg.port()
); );
if (conn) { if (conn) {
RemoveRequest(req->hdr_copy->socket_handle); RemoveRequest(req->socket_handle);
conn->ForwardClientMsgEx(req->hdr_copy); conn->ForwardClientMsgEx(req->hdr_copy);
return; return;
} else { } else {
abort(); abort();
} }
} }
RemoveRequest(req->hdr_copy->socket_handle); RemoveRequest(req->socket_handle);
} }
} }
@ -107,6 +108,7 @@ void MasterMgr::RequestTargetServer(f8::MsgHdr& hdr,
++curr_context_id_; ++curr_context_id_;
auto req = std::make_shared<RequestTarget>(); auto req = std::make_shared<RequestTarget>();
req->context_id = curr_context_id_; req->context_id = curr_context_id_;
req->socket_handle = hdr.socket_handle;
req->hdr_copy = hdr.Clone(); req->hdr_copy = hdr.Clone();
ss::SS_WSP_RequestTargetServer msg; ss::SS_WSP_RequestTargetServer msg;
@ -128,13 +130,13 @@ void MasterMgr::RequestTargetServer(f8::MsgHdr& hdr,
if (a8::TIMER_EXEC_EVENT == event) { if (a8::TIMER_EXEC_EVENT == event) {
MasterMgr::Instance()->RemoveRequest MasterMgr::Instance()->RemoveRequest
( (
req->hdr_copy->socket_handle req->socket_handle
); );
long long req_handle_time = a8::XGetTickCount() - req->req_tick; long long req_handle_time = a8::XGetTickCount() - req->req_tick;
if (req_handle_time > App::Instance()->perf.max_login_time) { if (req_handle_time > App::Instance()->perf.max_login_time) {
App::Instance()->perf.max_login_time = req_handle_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);
} }
} }
); );