summaryrefslogtreecommitdiff
path: root/source3/torture/msgtest.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-01-21 07:31:33 +0100
committerStefan Metzmacher <metze@samba.org>2009-01-22 12:37:31 +0100
commita4d605344bcd16d01b7049c477d99f8d9841f13c (patch)
tree2b7b014294a16ab60d8b4b77071a437ed154d281 /source3/torture/msgtest.c
parentc44a0ae87aef333570ce588fc9b46392dd528030 (diff)
downloadsamba-a4d605344bcd16d01b7049c477d99f8d9841f13c.tar.gz
samba-a4d605344bcd16d01b7049c477d99f8d9841f13c.tar.bz2
samba-a4d605344bcd16d01b7049c477d99f8d9841f13c.zip
s3:msgtest: don't call message_dispatch() anymore, use tevent_loop_once() instead
metze
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) {