From a4d605344bcd16d01b7049c477d99f8d9841f13c Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 21 Jan 2009 07:31:33 +0100 Subject: s3:msgtest: don't call message_dispatch() anymore, use tevent_loop_once() instead metze --- source3/torture/msgtest.c | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) (limited to 'source3/torture') 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 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) { -- cgit