From df89b4853954b7dcc86839167760cf72af693656 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 12 Sep 2000 06:57:25 +0000 Subject: - fixed some memory leaks in the messages code - added a MSG_PING message for performance testing. (This used to be commit e779f834dbb875669c3aa0a35b324aa13f0c8c36) --- source3/utils/msgtest.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'source3/utils') diff --git a/source3/utils/msgtest.c b/source3/utils/msgtest.c index 22d7a9a331..4821aef80b 100644 --- a/source3/utils/msgtest.c +++ b/source3/utils/msgtest.c @@ -36,12 +36,21 @@ #include "includes.h" +static int pong_count; + +/**************************************************************************** +a useful function for testing the message system +****************************************************************************/ +void pong_message(int msg_type, pid_t src, void *buf, size_t len) +{ + pong_count++; +} int main(int argc, char *argv[]) { pid_t pid; - int level; + int i, n; static pstring servicesf = CONFIGFILE; TimeInit(); @@ -54,9 +63,18 @@ message_init(); pid = atoi(argv[1]); - level = atoi(argv[2]); + n = atoi(argv[2]); + + message_register(MSG_PONG, pong_message); + + for (i=0;i