1
This commit is contained in:
parent
573e381c4b
commit
5d45ddbdd9
@ -101,7 +101,45 @@ void GSMgr::_SS_WSP_RequestTargetServer(f8::MsgHdr* hdr, const ss::SS_WSP_Reques
|
|||||||
|
|
||||||
void GSMgr::_SS_WSP_HttpTunnelRequest(f8::MsgHdr* hdr, const ss::SS_WSP_HttpTunnelRequest& msg)
|
void GSMgr::_SS_WSP_HttpTunnelRequest(f8::MsgHdr* hdr, const ss::SS_WSP_HttpTunnelRequest& msg)
|
||||||
{
|
{
|
||||||
|
ss::SS_MS_HttpTunnelResponse rspmsg;
|
||||||
|
a8::XObject request;
|
||||||
|
request.ReadFromUrlQueryString(msg.query_str());
|
||||||
|
std::string team_uuid = request.At("team_uuid")->AsXValue().GetString();
|
||||||
|
|
||||||
|
std::shared_ptr<GSNode> node = GetNodeByTeamId(team_uuid);
|
||||||
|
#ifdef DEBUG
|
||||||
|
a8::XPrintf("SS_WSP_HttpTunnelRequest %s\n" , {f8::PbToJson(&msg)});
|
||||||
|
{
|
||||||
|
if (request.HasKey("server_id")) {
|
||||||
|
node = GetNodeByInstanceId(request.At("server_id")->AsXValue());
|
||||||
|
if (!node) {
|
||||||
|
rspmsg.set_error_code(1);
|
||||||
|
rspmsg.set_error_msg("cant alloc node1");
|
||||||
|
GGListener::Instance()->SendMsg(hdr->socket_handle, rspmsg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
rspmsg.set_error_code(0);
|
||||||
|
rspmsg.set_error_msg("");
|
||||||
|
rspmsg.set_context_id(msg.context_id());
|
||||||
|
rspmsg.set_host(node->ip);
|
||||||
|
rspmsg.set_port(node->port);
|
||||||
|
GGListener::Instance()->SendMsg(hdr->socket_handle, rspmsg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
if (!node) {
|
||||||
|
rspmsg.set_error_code(1);
|
||||||
|
rspmsg.set_error_msg("cant alloc node1");
|
||||||
|
GGListener::Instance()->SendMsg(hdr->socket_handle, rspmsg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
rspmsg.set_error_code(0);
|
||||||
|
rspmsg.set_error_msg("");
|
||||||
|
rspmsg.set_context_id(msg.context_id());
|
||||||
|
rspmsg.set_host(node->ip);
|
||||||
|
rspmsg.set_port(node->port);
|
||||||
|
GGListener::Instance()->SendMsg(hdr->socket_handle, rspmsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GSMgr::_SS_Ping(f8::MsgHdr* hdr, const ss::SS_Ping& msg)
|
void GSMgr::_SS_Ping(f8::MsgHdr* hdr, const ss::SS_Ping& msg)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user