mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 20:23:06 +00:00
check agent
This commit is contained in:
@@ -59,8 +59,10 @@ _parm(char *msg, int sz, int command_sz) {
|
|||||||
static void
|
static void
|
||||||
_forward_agent(struct gate * g, int id, uint32_t agentaddr, uint32_t clientaddr) {
|
_forward_agent(struct gate * g, int id, uint32_t agentaddr, uint32_t clientaddr) {
|
||||||
struct connection * agent = _id_to_agent(g,id);
|
struct connection * agent = _id_to_agent(g,id);
|
||||||
agent->agent = agentaddr;
|
if (agent) {
|
||||||
agent->client = clientaddr;
|
agent->agent = agentaddr;
|
||||||
|
agent->client = clientaddr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -137,6 +139,8 @@ _forward(struct skynet_context * ctx,struct gate *g, int uid, void * data, size_
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
struct connection * agent = _id_to_agent(g,uid);
|
struct connection * agent = _id_to_agent(g,uid);
|
||||||
|
if (agent == NULL)
|
||||||
|
return;
|
||||||
if (agent->agent) {
|
if (agent->agent) {
|
||||||
skynet_send(ctx, agent->client, agent->agent, g->client_tag, 0 , data, len);
|
skynet_send(ctx, agent->client, agent->agent, g->client_tag, 0 , data, len);
|
||||||
} else if (g->watchdog) {
|
} else if (g->watchdog) {
|
||||||
|
|||||||
Reference in New Issue
Block a user