fix a legacy problem. make harbor service more stable

This commit is contained in:
Cloud Wu
2018-02-12 17:47:57 +08:00
committed by 云风
parent 484404295e
commit 0846a6533d
4 changed files with 21 additions and 9 deletions

View File

@@ -11,12 +11,15 @@
static struct skynet_context * REMOTE = 0;
static unsigned int HARBOR = ~0;
static inline int
invalid_type(int type) {
return type != PTYPE_SYSTEM && type != PTYPE_HARBOR;
}
void
skynet_harbor_send(struct remote_message *rmsg, uint32_t source, int session) {
int type = rmsg->sz >> MESSAGE_TYPE_SHIFT;
rmsg->sz &= MESSAGE_TYPE_MASK;
assert(type != PTYPE_SYSTEM && type != PTYPE_HARBOR && REMOTE);
skynet_context_send(REMOTE, rmsg, sizeof(*rmsg) , source, type , session);
assert(invalid_type(rmsg->type) && REMOTE);
skynet_context_send(REMOTE, rmsg, sizeof(*rmsg) , source, PTYPE_SYSTEM , session);
}
int