Skip to content

Commit

Permalink
check callback return value for reserve the message
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudwu committed Apr 18, 2014
1 parent d568e54 commit cfbd68b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions skynet-src/skynet_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,9 @@ _dispatch_message(struct skynet_context *ctx, struct skynet_message *msg) {
CHECKCALLING_BEGIN(ctx)
int type = msg->sz >> HANDLE_REMOTE_SHIFT;
size_t sz = msg->sz & HANDLE_MASK;
ctx->cb(ctx, ctx->cb_ud, type, msg->session, msg->source, msg->data, sz);
free(msg->data);
if (!ctx->cb(ctx, ctx->cb_ud, type, msg->session, msg->source, msg->data, sz)) {
free(msg->data);
}
CHECKCALLING_END(ctx)
}

Expand Down

0 comments on commit cfbd68b

Please sign in to comment.