summaryrefslogtreecommitdiff
path: root/source3/torture/msgtest.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2009-01-22 22:49:30 +0100
committerJelmer Vernooij <jelmer@samba.org>2009-01-22 22:49:30 +0100
commit1fcd85e8b9235301c7bc6c4c0878e73ddcbd4b16 (patch)
tree769f8e097b5225d8627bbb6698106000f226754e /source3/torture/msgtest.c
parentebb929779bf9f4aa0cb9695a3ee5ce5d550bcecc (diff)
parent8e2b48e1b7c7fd6b6080f2e56f654b682c6426a3 (diff)
downloadsamba-1fcd85e8b9235301c7bc6c4c0878e73ddcbd4b16.tar.gz
samba-1fcd85e8b9235301c7bc6c4c0878e73ddcbd4b16.tar.bz2
samba-1fcd85e8b9235301c7bc6c4c0878e73ddcbd4b16.zip
Merge branch 'master' of ssh://git.samba.org/data/git/samba
Diffstat (limited to 'source3/torture/msgtest.c')
-rw-r--r--source3/torture/msgtest.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/source3/torture/msgtest.c b/source3/torture/msgtest.c
index 1bb616f6e1..c447ac63d0 100644
--- a/source3/torture/msgtest.c
+++ b/source3/torture/msgtest.c
@@ -39,11 +39,12 @@ static void pong_message(struct messaging_context *msg_ctx,
int main(int argc, char *argv[])
{
- struct event_context *evt_ctx;
+ struct tevent_context *evt_ctx;
struct messaging_context *msg_ctx;
pid_t pid;
int i, n;
char buf[12];
+ int ret;
load_case_tables();
@@ -51,7 +52,7 @@ static void pong_message(struct messaging_context *msg_ctx,
lp_load(get_dyn_CONFIGFILE(),False,False,False,True);
- if (!(evt_ctx = event_context_init(NULL)) ||
+ if (!(evt_ctx = tevent_context_init(NULL)) ||
!(msg_ctx = messaging_init(NULL, server_id_self(), evt_ctx))) {
fprintf(stderr, "could not init messaging context\n");
exit(1);
@@ -74,8 +75,10 @@ static void pong_message(struct messaging_context *msg_ctx,
}
while (pong_count < i) {
- message_dispatch(msg_ctx);
- smb_msleep(1);
+ ret = tevent_loop_once(evt_ctx);
+ if (ret != 0) {
+ break;
+ }
}
/* Now test that the duplicate filtering code works. */
@@ -91,8 +94,10 @@ static void pong_message(struct messaging_context *msg_ctx,
}
for (i=0;i<n;i++) {
- message_dispatch(msg_ctx);
- smb_msleep(1);
+ ret = tevent_loop_once(evt_ctx);
+ if (ret != 0) {
+ break;
+ }
}
if (pong_count != 2) {
@@ -121,14 +126,20 @@ static void pong_message(struct messaging_context *msg_ctx,
ping_count++;
while (ping_count > pong_count + 20) {
- message_dispatch(msg_ctx);
+ ret = tevent_loop_once(evt_ctx);
+ if (ret != 0) {
+ break;
+ }
}
}
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(msg_ctx);
+ ret = tevent_loop_once(evt_ctx);
+ if (ret != 0) {
+ break;
+ }
}
if (ping_count != pong_count) {