From ffb63e4f8ec2b7390cbb00bca74a9bedb8399a91 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 19 Jun 2001 02:02:19 +0000 Subject: moved all our torture code to a separate directory (This used to be commit dd12c47645e2d0e832bc555492a6a8725a4495ee) --- source3/torture/msgtest.c | 96 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 source3/torture/msgtest.c (limited to 'source3/torture/msgtest.c') diff --git a/source3/torture/msgtest.c b/source3/torture/msgtest.c new file mode 100644 index 0000000000..3fbf95af8f --- /dev/null +++ b/source3/torture/msgtest.c @@ -0,0 +1,96 @@ +/* + Unix SMB/Netbios implementation. + Version 3.0 + Copyright (C) Andrew Tridgell 2000 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +/* + test code for internal messaging + */ + +#define NO_SYSLOG + +#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 i, n; + static pstring servicesf = CONFIGFILE; + char buf[12]; + + TimeInit(); + setup_logging(argv[0],True); + + charset_initialise(); + + lp_load(servicesf,False,False,False); + + message_init(); + + if (argc != 3) { + fprintf(stderr, "%s: Usage - %s pid count\n", argv[0], argv[0]); + exit(1); + } + + pid = atoi(argv[1]); + n = atoi(argv[2]); + + message_register(MSG_PONG, pong_message); + + for (i=0;i Date: Wed, 4 Jul 2001 07:15:53 +0000 Subject: The big character set handling changeover! This commit gets rid of all our old codepage handling and replaces it with iconv. All internal strings in Samba are now in "unix" charset, which may be multi-byte. See internals.doc and my posting to samba-technical for a more complete explanation. (This used to be commit debb471267960e56005a741817ebd227ecfc512a) --- source3/torture/msgtest.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'source3/torture/msgtest.c') diff --git a/source3/torture/msgtest.c b/source3/torture/msgtest.c index 3fbf95af8f..f08d722803 100644 --- a/source3/torture/msgtest.c +++ b/source3/torture/msgtest.c @@ -46,8 +46,6 @@ void pong_message(int msg_type, pid_t src, void *buf, size_t len) TimeInit(); setup_logging(argv[0],True); - charset_initialise(); - lp_load(servicesf,False,False,False); message_init(); -- cgit From f741f656737f4ec46cd318e986b6bf412ed309d2 Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Mon, 19 Nov 2001 02:49:53 +0000 Subject: Store some path names in global variables initialized to configure default, rather than in preprocessor macros. (This used to be commit 79ec88f0da40faebe1e587f1b3e87b5f2b184f58) --- source3/torture/msgtest.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source3/torture/msgtest.c') diff --git a/source3/torture/msgtest.c b/source3/torture/msgtest.c index f08d722803..31bc1ee6e8 100644 --- a/source3/torture/msgtest.c +++ b/source3/torture/msgtest.c @@ -40,13 +40,12 @@ void pong_message(int msg_type, pid_t src, void *buf, size_t len) { pid_t pid; int i, n; - static pstring servicesf = CONFIGFILE; char buf[12]; TimeInit(); setup_logging(argv[0],True); - lp_load(servicesf,False,False,False); + lp_load(dyn_CONFIGFILE,False,False,False); message_init(); -- cgit From 79b34d1b11e685d068b9c0ac9a0ec06eaa263d82 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Fri, 23 Nov 2001 00:52:29 +0000 Subject: Removed TimeInit() call from every client program (except for one place in smbd/process.c where the timezone is reinitialised. Was replaced with check for a static is_initialised boolean. (This used to be commit 8fc772c9e5770cd3a8857670214dcff033ebae32) --- source3/torture/msgtest.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/torture/msgtest.c') diff --git a/source3/torture/msgtest.c b/source3/torture/msgtest.c index 31bc1ee6e8..9f3c083b80 100644 --- a/source3/torture/msgtest.c +++ b/source3/torture/msgtest.c @@ -42,7 +42,6 @@ void pong_message(int msg_type, pid_t src, void *buf, size_t len) int i, n; char buf[12]; - TimeInit(); setup_logging(argv[0],True); lp_load(dyn_CONFIGFILE,False,False,False); -- cgit From cd68afe31256ad60748b34f7318a180cfc2127cc Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Wed, 30 Jan 2002 06:08:46 +0000 Subject: Removed version number from file header. Changed "SMB/Netbios" to "SMB/CIFS" in file header. (This used to be commit 6a58c9bd06d0d7502a24bf5ce5a2faf0a146edfa) --- source3/torture/msgtest.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source3/torture/msgtest.c') diff --git a/source3/torture/msgtest.c b/source3/torture/msgtest.c index 9f3c083b80..8abb0a20d2 100644 --- a/source3/torture/msgtest.c +++ b/source3/torture/msgtest.c @@ -1,6 +1,5 @@ /* - Unix SMB/Netbios implementation. - Version 3.0 + Unix SMB/CIFS implementation. Copyright (C) Andrew Tridgell 2000 This program is free software; you can redistribute it and/or modify -- cgit From c507ebe56741d773bf6e7ad547863a2da1aee687 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 10 May 2003 10:53:48 +0000 Subject: Patch from metze and me that adds dummy smb_register_*() functions so that is now possible to, for example, load a module which contains an auth method into a binary without the auth/ subsystem built in. (This used to be commit 74d9ecfe2dd7364643d32acb62ade957bd71cd0d) --- source3/torture/msgtest.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/torture/msgtest.c') diff --git a/source3/torture/msgtest.c b/source3/torture/msgtest.c index 8abb0a20d2..091b6337ab 100644 --- a/source3/torture/msgtest.c +++ b/source3/torture/msgtest.c @@ -25,6 +25,8 @@ #include "includes.h" +#include "module_dummy.h" + static int pong_count; /**************************************************************************** -- cgit From 0914e541f5480834c1b0ddc98b5f71f7f7abf9cb Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 10 May 2003 11:49:51 +0000 Subject: Reverse previous patch from Stefan and me after comments by Andrew Bartlett (This used to be commit d817eaf0ecca2d878ab1ffcf7a747a02d71c811e) --- source3/torture/msgtest.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'source3/torture/msgtest.c') diff --git a/source3/torture/msgtest.c b/source3/torture/msgtest.c index 091b6337ab..8abb0a20d2 100644 --- a/source3/torture/msgtest.c +++ b/source3/torture/msgtest.c @@ -25,8 +25,6 @@ #include "includes.h" -#include "module_dummy.h" - static int pong_count; /**************************************************************************** -- cgit From 24df38dbc6648261f86adcffd664ffc43f8f3346 Mon Sep 17 00:00:00 2001 From: Jim McDonough Date: Mon, 23 Feb 2004 02:54:03 +0000 Subject: Janitor for tpot...bugzilla #1098, msleep already exists on aix (This used to be commit 4319df7fdc2d878c509381923cc1db4d731620ba) --- source3/torture/msgtest.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/torture/msgtest.c') diff --git a/source3/torture/msgtest.c b/source3/torture/msgtest.c index 8abb0a20d2..c40973a75c 100644 --- a/source3/torture/msgtest.c +++ b/source3/torture/msgtest.c @@ -63,7 +63,7 @@ void pong_message(int msg_type, pid_t src, void *buf, size_t len) while (pong_count < i) { message_dispatch(); - msleep(1); + smb_msleep(1); } /* Now test that the duplicate filtering code works. */ @@ -78,7 +78,7 @@ void pong_message(int msg_type, pid_t src, void *buf, size_t len) for (i=0;i Date: Tue, 19 Jul 2005 02:37:04 +0000 Subject: r8572: Remove crufty #define NO_SYSLOG as it's not used at all anymore. (This used to be commit 985dbb47d925e79c1195ca219f7ab5d6648b22b8) --- source3/torture/msgtest.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'source3/torture/msgtest.c') diff --git a/source3/torture/msgtest.c b/source3/torture/msgtest.c index c40973a75c..ac55d70327 100644 --- a/source3/torture/msgtest.c +++ b/source3/torture/msgtest.c @@ -21,8 +21,6 @@ test code for internal messaging */ -#define NO_SYSLOG - #include "includes.h" static int pong_count; -- cgit From 54abd2aa66069e6baf7769c496f46d9dba18db39 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 30 Sep 2005 17:13:37 +0000 Subject: r10656: BIG merge from trunk. Features not copied over * \PIPE\unixinfo * winbindd's {group,alias}membership new functions * winbindd's lookupsids() functionality * swat (trunk changes to be reverted as per discussion with Deryck) (This used to be commit 939c3cb5d78e3a2236209b296aa8aba8bdce32d3) --- source3/torture/msgtest.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'source3/torture/msgtest.c') diff --git a/source3/torture/msgtest.c b/source3/torture/msgtest.c index ac55d70327..d691ab32f1 100644 --- a/source3/torture/msgtest.c +++ b/source3/torture/msgtest.c @@ -28,7 +28,7 @@ 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) +void pong_message(int msg_type, struct process_id src, void *buf, size_t len) { pong_count++; } @@ -56,7 +56,7 @@ void pong_message(int msg_type, pid_t src, void *buf, size_t len) message_register(MSG_PONG, pong_message); for (i=0;i Date: Sat, 28 Jan 2006 22:53:04 +0000 Subject: r13212: r12414@cabra: derrell | 2006-01-28 17:52:17 -0500 lp_load() could not be called multiple times to modify parameter settings based on reading from multiple configuration settings. Each time, it initialized all of the settings back to their defaults before reading the specified configuration file. This patch adds a parameter to lp_load() specifying whether the settings should be initialized. It does, however, still force the settings to be initialized the first time, even if the request was to not initialize them. (Not doing so could wreak havoc due to uninitialized values.) (This used to be commit f2a24de769d1b2266e576597c57a8e3b1e2a2b51) --- source3/torture/msgtest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/torture/msgtest.c') diff --git a/source3/torture/msgtest.c b/source3/torture/msgtest.c index d691ab32f1..f7c47ddbbf 100644 --- a/source3/torture/msgtest.c +++ b/source3/torture/msgtest.c @@ -41,7 +41,7 @@ void pong_message(int msg_type, struct process_id src, void *buf, size_t len) setup_logging(argv[0],True); - lp_load(dyn_CONFIGFILE,False,False,False); + lp_load(dyn_CONFIGFILE,False,False,False,True); message_init(); -- cgit From 4aead7efa30aed5b41bdf0156ee5be17a16700de Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 20 May 2006 02:04:19 +0000 Subject: r15727: Fix msgtest - noticed by Aleksey Fedoseev . Jeremy. (This used to be commit 9f5c95c41872deac5e029b69daa5004d5c0fb4cc) --- source3/torture/msgtest.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/torture/msgtest.c') diff --git a/source3/torture/msgtest.c b/source3/torture/msgtest.c index f7c47ddbbf..ede629be6b 100644 --- a/source3/torture/msgtest.c +++ b/source3/torture/msgtest.c @@ -39,6 +39,8 @@ void pong_message(int msg_type, struct process_id src, void *buf, size_t len) int i, n; char buf[12]; + load_case_tables(); + setup_logging(argv[0],True); lp_load(dyn_CONFIGFILE,False,False,False,True); -- cgit From 799f8c75b9af9f7b295637eee40ad66872c3211a Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 20 May 2006 02:09:35 +0000 Subject: r15729: Second part of Aleksey Fedoseev patch. Jeremy. (This used to be commit 5137006233a0c2de94ce3da7340ff0032ef7426d) --- source3/torture/msgtest.c | 55 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) (limited to 'source3/torture/msgtest.c') diff --git a/source3/torture/msgtest.c b/source3/torture/msgtest.c index ede629be6b..035214b3a9 100644 --- a/source3/torture/msgtest.c +++ b/source3/torture/msgtest.c @@ -25,6 +25,24 @@ static int pong_count; + +/* samba4 timeval functions */ + +double timeval_elapsed2(const struct timeval *tv1, const struct timeval *tv2) +{ + return (tv2->tv_sec - tv1->tv_sec) + + (tv2->tv_usec - tv1->tv_usec)*1.0e-6; +} + +/** + return the number of seconds elapsed since a given time +*/ +double timeval_elapsed(const struct timeval *tv) +{ + struct timeval tv2 = timeval_current(); + return timeval_elapsed2(tv, &tv2); +} + /**************************************************************************** a useful function for testing the message system ****************************************************************************/ @@ -85,7 +103,42 @@ void pong_message(int msg_type, struct process_id src, void *buf, size_t len) if (pong_count != 2) { fprintf(stderr, "Duplicate filter failed (%d).\n", pong_count); - exit(1); + } + + /* Speed testing */ + + pong_count = 0; + + { + struct timeval tv = timeval_current(); + size_t timelimit = n; + size_t ping_count = 0; + + printf("Sending pings for %d seconds\n", timelimit); + while (timeval_elapsed(&tv) < timelimit) { + if(message_send_pid(pid_to_procid(pid), MSG_PING, + buf, 11, False)) ping_count++; + if(message_send_pid(pid_to_procid(pid), MSG_PING, + NULL, 0, False)) ping_count++; + + while (ping_count > pong_count + 20) { + message_dispatch(); + } + } + + printf("waiting for %d remaining replies (done %d)\n", + ping_count - pong_count, pong_count); + while (timeval_elapsed(&tv) < 30 && pong_count < ping_count) { + message_dispatch(); + } + + if (ping_count != pong_count) { + fprintf(stderr, "ping test failed! received %d, sent %d\n", + pong_count, ping_count); + } + + printf("ping rate of %.0f messages/sec\n", + (ping_count+pong_count)/timeval_elapsed(&tv)); } return (0); -- cgit From 6dfccad5645ef0b459d5904ce48550f72acf8d37 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 11 Jul 2006 21:23:44 +0000 Subject: r16960: Some warnings from host "opi" (This used to be commit 083ef11cc9be8f1299f233bde194173e092e2c3c) --- source3/torture/msgtest.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source3/torture/msgtest.c') diff --git a/source3/torture/msgtest.c b/source3/torture/msgtest.c index 035214b3a9..557f4edf88 100644 --- a/source3/torture/msgtest.c +++ b/source3/torture/msgtest.c @@ -114,7 +114,7 @@ void pong_message(int msg_type, struct process_id src, void *buf, size_t len) size_t timelimit = n; size_t ping_count = 0; - printf("Sending pings for %d seconds\n", timelimit); + printf("Sending pings for %d seconds\n", (int)timelimit); while (timeval_elapsed(&tv) < timelimit) { if(message_send_pid(pid_to_procid(pid), MSG_PING, buf, 11, False)) ping_count++; @@ -127,14 +127,14 @@ void pong_message(int msg_type, struct process_id src, void *buf, size_t len) } printf("waiting for %d remaining replies (done %d)\n", - ping_count - pong_count, pong_count); + (int)(ping_count - pong_count), pong_count); while (timeval_elapsed(&tv) < 30 && pong_count < ping_count) { message_dispatch(); } if (ping_count != pong_count) { - fprintf(stderr, "ping test failed! received %d, sent %d\n", - pong_count, ping_count); + fprintf(stderr, "ping test failed! received %d, sent " + "%d\n", pong_count, (int)ping_count); } printf("ping rate of %.0f messages/sec\n", -- cgit From e7952e9c14218d0c8c13973056ab8762876e5a79 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 31 Jul 2006 21:11:03 +0000 Subject: r17347: Some C++ warnings -- 271 left (This used to be commit 641dac4f85c0e00484d90726bea1a4cb58c8235c) --- source3/torture/msgtest.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'source3/torture/msgtest.c') diff --git a/source3/torture/msgtest.c b/source3/torture/msgtest.c index 557f4edf88..0c7b57f80c 100644 --- a/source3/torture/msgtest.c +++ b/source3/torture/msgtest.c @@ -66,7 +66,8 @@ void pong_message(int msg_type, struct process_id src, void *buf, size_t len) message_init(); if (argc != 3) { - fprintf(stderr, "%s: Usage - %s pid count\n", argv[0], argv[0]); + fprintf(stderr, "%s: Usage - %s pid count\n", argv[0], + argv[0]); exit(1); } @@ -115,11 +116,11 @@ void pong_message(int msg_type, struct process_id src, void *buf, size_t len) size_t ping_count = 0; printf("Sending pings for %d seconds\n", (int)timelimit); - while (timeval_elapsed(&tv) < timelimit) { + while (timeval_elapsed(&tv) < timelimit) { if(message_send_pid(pid_to_procid(pid), MSG_PING, - buf, 11, False)) ping_count++; + buf, 11, False)) ping_count++; if(message_send_pid(pid_to_procid(pid), MSG_PING, - NULL, 0, False)) ping_count++; + NULL, 0, False)) ping_count++; while (ping_count > pong_count + 20) { message_dispatch(); @@ -138,7 +139,7 @@ void pong_message(int msg_type, struct process_id src, void *buf, size_t len) } printf("ping rate of %.0f messages/sec\n", - (ping_count+pong_count)/timeval_elapsed(&tv)); + (ping_count+pong_count)/timeval_elapsed(&tv)); } return (0); -- cgit From 995205fc60f87e1a02aa1c6f309db55ae18e908a Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 6 Sep 2006 18:32:20 +0000 Subject: r18188: merge 3.0-libndr branch (This used to be commit 1115745caed3093c25d6be01ffee21819fb0a675) --- source3/torture/msgtest.c | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'source3/torture/msgtest.c') diff --git a/source3/torture/msgtest.c b/source3/torture/msgtest.c index 0c7b57f80c..e8db20f4a8 100644 --- a/source3/torture/msgtest.c +++ b/source3/torture/msgtest.c @@ -26,23 +26,6 @@ static int pong_count; -/* samba4 timeval functions */ - -double timeval_elapsed2(const struct timeval *tv1, const struct timeval *tv2) -{ - return (tv2->tv_sec - tv1->tv_sec) + - (tv2->tv_usec - tv1->tv_usec)*1.0e-6; -} - -/** - return the number of seconds elapsed since a given time -*/ -double timeval_elapsed(const struct timeval *tv) -{ - struct timeval tv2 = timeval_current(); - return timeval_elapsed2(tv, &tv2); -} - /**************************************************************************** a useful function for testing the message system ****************************************************************************/ -- cgit From 55ed1d59455566d90a03e7123fbf7a05a4bd4539 Mon Sep 17 00:00:00 2001 From: Herb Lewis Date: Tue, 19 Dec 2006 20:16:52 +0000 Subject: r20261: merge 20260 from samba_3_0_24 clean up a bunch of no previous prototype warnings (This used to be commit c60687db112405262adf26dbf267804b04074e67) --- source3/torture/msgtest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/torture/msgtest.c') diff --git a/source3/torture/msgtest.c b/source3/torture/msgtest.c index e8db20f4a8..d913c4903f 100644 --- a/source3/torture/msgtest.c +++ b/source3/torture/msgtest.c @@ -29,7 +29,7 @@ static int pong_count; /**************************************************************************** a useful function for testing the message system ****************************************************************************/ -void pong_message(int msg_type, struct process_id src, void *buf, size_t len) +static void pong_message(int msg_type, struct process_id src, void *buf, size_t len) { pong_count++; } -- cgit From caf8c6a76be051559ffcfe97084edca43e0a3cee Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 30 Jan 2007 22:22:06 +0000 Subject: r21064: The core of this patch is void message_register(int msg_type, void (*fn)(int msg_type, struct process_id pid, - void *buf, size_t len)) + void *buf, size_t len, + void *private_data), + void *private_data) { struct dispatch_fns *dfn; So this adds a (so far unused) private pointer that is passed from message_register to the message handler. A prerequisite to implement a tiny samba4-API compatible wrapper around our messaging system. That itself is necessary for the Samba4 notify system. Yes, I know, I could import the whole Samba4 messaging system, but I want to do it step by step and I think getting notify in is more important in this step. Volker (This used to be commit c8ae60ed65dcce9660ee39c75488f2838cf9a28b) --- source3/torture/msgtest.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source3/torture/msgtest.c') diff --git a/source3/torture/msgtest.c b/source3/torture/msgtest.c index d913c4903f..ad1b35a9dd 100644 --- a/source3/torture/msgtest.c +++ b/source3/torture/msgtest.c @@ -29,7 +29,8 @@ static int pong_count; /**************************************************************************** a useful function for testing the message system ****************************************************************************/ -static void pong_message(int msg_type, struct process_id src, void *buf, size_t len) +static void pong_message(int msg_type, struct process_id src, + void *buf, size_t len, void *private_data) { pong_count++; } @@ -57,7 +58,7 @@ static void pong_message(int msg_type, struct process_id src, void *buf, size_t pid = atoi(argv[1]); n = atoi(argv[2]); - message_register(MSG_PONG, pong_message); + message_register(MSG_PONG, pong_message, NULL); for (i=0;i Date: Thu, 1 Feb 2007 22:06:59 +0000 Subject: r21116: Fix the build -- sorry! (This used to be commit f4b073d8c85070290f475e7e2575c1233b9a9c4e) --- source3/torture/msgtest.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'source3/torture/msgtest.c') diff --git a/source3/torture/msgtest.c b/source3/torture/msgtest.c index ad1b35a9dd..5a066bc599 100644 --- a/source3/torture/msgtest.c +++ b/source3/torture/msgtest.c @@ -101,10 +101,14 @@ static void pong_message(int msg_type, struct process_id src, printf("Sending pings for %d seconds\n", (int)timelimit); while (timeval_elapsed(&tv) < timelimit) { - if(message_send_pid(pid_to_procid(pid), MSG_PING, - buf, 11, False)) ping_count++; - if(message_send_pid(pid_to_procid(pid), MSG_PING, - NULL, 0, False)) ping_count++; + if(NT_STATUS_IS_OK(message_send_pid(pid_to_procid(pid), + MSG_PING, + buf, 11, False))) + ping_count++; + if(NT_STATUS_IS_OK(message_send_pid(pid_to_procid(pid), + MSG_PING, + NULL, 0, False))) + ping_count++; while (ping_count > pong_count + 20) { message_dispatch(); -- cgit From e6383f47629368d9dd4e803f17566a24e9d7359e Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 7 May 2007 09:35:35 +0000 Subject: r22736: Start to merge the low-hanging fruit from the now 7000-line cluster patch. This changes "struct process_id" to "struct server_id", keeping both is just too much hassle. No functional change (I hope ;-)) Volker (This used to be commit 0ad4b1226c9d91b72136310d3bbb640d2c5d67b8) --- source3/torture/msgtest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/torture/msgtest.c') diff --git a/source3/torture/msgtest.c b/source3/torture/msgtest.c index 5a066bc599..703832c7b4 100644 --- a/source3/torture/msgtest.c +++ b/source3/torture/msgtest.c @@ -29,7 +29,7 @@ static int pong_count; /**************************************************************************** a useful function for testing the message system ****************************************************************************/ -static void pong_message(int msg_type, struct process_id src, +static void pong_message(int msg_type, struct server_id src, void *buf, size_t len, void *private_data) { pong_count++; -- cgit From 331041139f2389baab6ba28483121abc31c1a870 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 15 May 2007 14:39:18 +0000 Subject: r22906: Some more message_send_pid (This used to be commit 8abf9f396375b42d838e992b3a4e40e68e550ab2) --- source3/torture/msgtest.c | 41 +++++++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 14 deletions(-) (limited to 'source3/torture/msgtest.c') diff --git a/source3/torture/msgtest.c b/source3/torture/msgtest.c index 703832c7b4..18674ef0f5 100644 --- a/source3/torture/msgtest.c +++ b/source3/torture/msgtest.c @@ -29,14 +29,19 @@ static int pong_count; /**************************************************************************** a useful function for testing the message system ****************************************************************************/ -static void pong_message(int msg_type, struct server_id src, - void *buf, size_t len, void *private_data) +static void pong_message(struct messaging_context *msg_ctx, + void *private_data, + uint32_t msg_type, + struct server_id pid, + DATA_BLOB *data) { pong_count++; } int main(int argc, char *argv[]) { + struct event_context *evt_ctx; + struct messaging_context *msg_ctx; pid_t pid; int i, n; char buf[12]; @@ -49,6 +54,12 @@ static void pong_message(int msg_type, struct server_id src, message_init(); + if (!(evt_ctx = event_context_init(NULL)) || + !(msg_ctx = messaging_init(NULL, server_id_self(), evt_ctx))) { + fprintf(stderr, "could not init messaging context\n"); + exit(1); + } + if (argc != 3) { fprintf(stderr, "%s: Usage - %s pid count\n", argv[0], argv[0]); @@ -58,10 +69,11 @@ static void pong_message(int msg_type, struct server_id src, pid = atoi(argv[1]); n = atoi(argv[2]); - message_register(MSG_PONG, pong_message, NULL); + messaging_register(msg_ctx, NULL, MSG_PONG, pong_message); for (i=0;i pong_count + 20) { -- cgit From 84758bd1f8633d3efe30e293887596db6bfd5e5b Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 15 May 2007 15:14:32 +0000 Subject: r22908: All callers of message_init now also call messaging_init. Unify those. (This used to be commit 330946ad2307ca34f0a8d068a0193fcb8a0d6036) --- source3/torture/msgtest.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'source3/torture/msgtest.c') diff --git a/source3/torture/msgtest.c b/source3/torture/msgtest.c index 18674ef0f5..20e5230a60 100644 --- a/source3/torture/msgtest.c +++ b/source3/torture/msgtest.c @@ -52,8 +52,6 @@ static void pong_message(struct messaging_context *msg_ctx, lp_load(dyn_CONFIGFILE,False,False,False,True); - message_init(); - if (!(evt_ctx = event_context_init(NULL)) || !(msg_ctx = messaging_init(NULL, server_id_self(), evt_ctx))) { fprintf(stderr, "could not init messaging context\n"); -- cgit From ac3f08ddbe0b484375624db0e35999a8584b57f4 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 21 May 2007 22:17:13 +0000 Subject: r23055: Rewrite messages.c to use auto-generated marshalling in the tdb. I'm doing this because for the clustering the marshalling is needed in more than one place, so I wanted a decent routine to marshall a message_rec struct which was not there before. Tridge, this seems about the same speed as it used to be before, the librpc/ndr overhead in my tests was under the noise. Volker (This used to be commit eaefd00563173dfabb7716c5695ac0a2f7139bb6) --- source3/torture/msgtest.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source3/torture/msgtest.c') diff --git a/source3/torture/msgtest.c b/source3/torture/msgtest.c index 20e5230a60..d8c280e69b 100644 --- a/source3/torture/msgtest.c +++ b/source3/torture/msgtest.c @@ -75,7 +75,7 @@ static void pong_message(struct messaging_context *msg_ctx, } while (pong_count < i) { - message_dispatch(); + message_dispatch(msg_ctx); smb_msleep(1); } @@ -92,7 +92,7 @@ static void pong_message(struct messaging_context *msg_ctx, } for (i=0;i pong_count + 20) { - message_dispatch(); + message_dispatch(msg_ctx); } } printf("waiting for %d remaining replies (done %d)\n", (int)(ping_count - pong_count), pong_count); while (timeval_elapsed(&tv) < 30 && pong_count < ping_count) { - message_dispatch(); + message_dispatch(msg_ctx); } if (ping_count != pong_count) { -- cgit From d824b98f80ba186030cbb70b3a1e5daf80469ecd Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 9 Jul 2007 19:25:36 +0000 Subject: r23779: Change from v2 or later to v3 or later. Jeremy. (This used to be commit 407e6e695b8366369b7c76af1ff76869b45347b3) --- source3/torture/msgtest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/torture/msgtest.c') diff --git a/source3/torture/msgtest.c b/source3/torture/msgtest.c index d8c280e69b..9019e6a957 100644 --- a/source3/torture/msgtest.c +++ b/source3/torture/msgtest.c @@ -4,7 +4,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, -- cgit From 5e54558c6dea67b56bbfaba5698f3a434d3dffb6 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 00:52:41 +0000 Subject: r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text (This used to be commit b0132e94fc5fef936aa766fb99a306b3628e9f07) --- source3/torture/msgtest.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source3/torture/msgtest.c') diff --git a/source3/torture/msgtest.c b/source3/torture/msgtest.c index 9019e6a957..3ef1d1e600 100644 --- a/source3/torture/msgtest.c +++ b/source3/torture/msgtest.c @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ /* -- cgit From 7faee02d0d351c5c039e8f1be7e82ce3a93cbe96 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 10 Dec 2007 11:30:37 -0800 Subject: Remove the char[1024] strings from dynconfig. Replace them with malloc'ing accessor functions. Should save a lot of static space :-). Jeremy. (This used to be commit 52dc5eaef2106015b3a8b659e818bdb15ad94b05) --- source3/torture/msgtest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/torture/msgtest.c') diff --git a/source3/torture/msgtest.c b/source3/torture/msgtest.c index 3ef1d1e600..1bb616f6e1 100644 --- a/source3/torture/msgtest.c +++ b/source3/torture/msgtest.c @@ -49,7 +49,7 @@ static void pong_message(struct messaging_context *msg_ctx, setup_logging(argv[0],True); - lp_load(dyn_CONFIGFILE,False,False,False,True); + lp_load(get_dyn_CONFIGFILE(),False,False,False,True); if (!(evt_ctx = event_context_init(NULL)) || !(msg_ctx = messaging_init(NULL, server_id_self(), evt_ctx))) { -- cgit