If we receive a message that is not handled then emit a gentle warning
authorMartin Pool <mbp@samba.org>
Thu, 3 Jan 2002 03:42:33 +0000 (03:42 +0000)
committerMartin Pool <mbp@samba.org>
Thu, 3 Jan 2002 03:42:33 +0000 (03:42 +0000)
to the log.
(This used to be commit 53dd8b45397f5de7660594b9287341f8f4c91c43)

source3/lib/messages.c

index 5561127410cf37b4e7205bba2b023e0c1a21d581..cd7eb8b82f9435f075cd08ce9954ee23ca95c478 100644 (file)
@@ -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);
        }
 }