From 010d1c1d4f9826de9f56868ef13faba1261d59d8 Mon Sep 17 00:00:00 2001 From: Cloud Wu Date: Mon, 24 Aug 2015 11:50:40 +0800 Subject: [PATCH] avoid dead loop --- service-src/service_harbor.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/service-src/service_harbor.c b/service-src/service_harbor.c index 5ff618f1..ed05190b 100644 --- a/service-src/service_harbor.c +++ b/service-src/service_harbor.c @@ -317,8 +317,11 @@ forward_local_messsage(struct harbor *h, void *msg, int sz) { destination = (destination & HANDLE_MASK) | ((uint32_t)h->id << HANDLE_REMOTE_SHIFT); if (skynet_send(h->ctx, header.source, destination, type, (int)header.session, (void *)msg, sz-HEADER_COOKIE_LENGTH) < 0) { - skynet_send(h->ctx, destination, header.source , PTYPE_ERROR, (int)header.session, NULL, 0); - skynet_error(h->ctx, "Unknown destination :%x from :%x", destination, header.source); + if (type != PTYPE_ERROR) { + // don't need report error when type is error + skynet_send(h->ctx, destination, header.source , PTYPE_ERROR, (int)header.session, NULL, 0); + } + skynet_error(h->ctx, "Unknown destination :%x from :%x type(%d)", destination, header.source, type); } }