From 1a09c706fc09952c6c58e9a88a62d208b61903c5 Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Thu, 3 Jan 2002 03:42:33 +0000 Subject: If we receive a message that is not handled then emit a gentle warning to the log. (This used to be commit 53dd8b45397f5de7660594b9287341f8f4c91c43) --- source3/lib/messages.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source3/lib/messages.c b/source3/lib/messages.c index 5561127410..cd7eb8b82f 100644 --- a/source3/lib/messages.c +++ b/source3/lib/messages.c @@ -314,6 +314,7 @@ void message_dispatch(void) void *buf; size_t len; struct dispatch_fns *dfn; + int n_handled; if (!received_signal) return; @@ -324,12 +325,19 @@ void message_dispatch(void) while (message_recv(&msg_type, &src, &buf, &len)) { DEBUG(10,("message_dispatch: received msg_type=%d src_pid=%d\n", msg_type, (int) src)); + n_handled = 0; for (dfn = dispatch_fns; dfn; dfn = dfn->next) { if (dfn->msg_type == msg_type) { DEBUG(10,("message_dispatch: processing message of type %d.\n", msg_type)); dfn->fn(msg_type, src, buf, len); + n_handled++; } } + if (!n_handled) { + DEBUG(5,("message_dispatch: warning: no handlers registed for " + "msg_type %d in pid%d\n", + msg_type, getpid())); + } SAFE_FREE(buf); } } -- cgit