This commit is contained in:
azw 2023-11-13 08:09:41 +00:00
parent 765b0b95cf
commit e215104358
2 changed files with 28 additions and 7 deletions

View File

@ -97,7 +97,7 @@ void HandlerMgr::ProcGMMsg(unsigned long saddr, int sockhandle,
[sockhandle] (const a8::Args& args)
{
std::string data = args.Get<std::string>(0);
GCListener::Instance()->SendText(sockhandle, a8::HttpResponse(data));
GCListener::Instance()->SendText(sockhandle, data);
});
itr->second(request);
} else {

View File

@ -58,6 +58,15 @@ void MasterMgr::_SS_MS_ResponseTargetServer(f8::MsgHdr* hdr, const ss::SS_MS_Res
{
auto req = GetRequestByContextId(msg.context_id());
if (req) {
#ifdef DEBUG
a8::XPrintf("error_code:%d error_msg:%s host:%s port:%d\n",
{
msg.error_code(),
msg.error_msg(),
msg.host(),
msg.port()
});
#endif
if (msg.error_code() == 0) {
std::weak_ptr<UpStream> conn = UpStreamMgr::Instance()->RecreateUpStream
(
@ -99,6 +108,15 @@ void MasterMgr::RequestTargetServer(f8::MsgHdr* hdr,
int is_reconnect,
int proto_version)
{
#ifdef DEBUG
a8::XPrintf("RequestTargetServer team_id:%s account_id:%s server_info:%s is_reconnect:%d\n",
{
team_id,
account_id,
server_info,
is_reconnect
});
#endif
if (GetRequestBySocket(hdr->socket_handle)) {
return;
}
@ -154,21 +172,24 @@ void MasterMgr::RequestTargetServer(f8::MsgHdr* hdr,
[req] (int event, const a8::Args* args)
{
if (a8::TIMER_EXEC_EVENT == event) {
MasterMgr::Instance()->RemoveRequest
(
req->socket_handle
);
MasterMgr::Instance()->RemoveRequest(req->socket_handle);
long long req_handle_time = a8::XGetTickCount() - req->req_tick;
if (req_handle_time > App::Instance()->GetPerf().max_login_time) {
App::Instance()->GetPerf().max_login_time = req_handle_time;
}
DownStreamMgr::Instance()->AddPendingAccount(req->account_id, req->socket_handle, req->req_tick);
DownStreamMgr::Instance()->AddPendingAccount
(req->account_id,
req->socket_handle,
req->req_tick);
} else if (ALLOC_TARGET_SERVER_SUCCESS_TIMER_EVENT == event) {
long long req_handle_time = a8::XGetTickCount() - req->req_tick;
if (req_handle_time > App::Instance()->GetPerf().max_login_time) {
App::Instance()->GetPerf().max_login_time = req_handle_time;
}
DownStreamMgr::Instance()->AddPendingAccount(req->account_id, req->socket_handle, req->req_tick);
DownStreamMgr::Instance()->AddPendingAccount
(req->account_id,
req->socket_handle,
req->req_tick);
}
}
);