summaryrefslogtreecommitdiff
path: root/source3/torture/test_async_echo.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-07-27 18:35:00 +0200
committerVolker Lendecke <vl@samba.org>2011-07-27 21:55:21 +0200
commit34faeb8bba86fff57466c06682b7dcbffc48a52a (patch)
tree8c61246f2f5e6eb134dfdc9eeadd905276215ec2 /source3/torture/test_async_echo.c
parentabf3573c21510717edb0fb9ce5080c1a24c35714 (diff)
downloadsamba-34faeb8bba86fff57466c06682b7dcbffc48a52a.tar.gz
samba-34faeb8bba86fff57466c06682b7dcbffc48a52a.tar.bz2
samba-34faeb8bba86fff57466c06682b7dcbffc48a52a.zip
s3:test_async_echo: unsure the desired smb message sequence
We want to start sending echo requests once the rpc related smb operation arrived the smb layer. metze
Diffstat (limited to 'source3/torture/test_async_echo.c')
-rw-r--r--source3/torture/test_async_echo.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source3/torture/test_async_echo.c b/source3/torture/test_async_echo.c
index 6f829394db..f1d44ee681 100644
--- a/source3/torture/test_async_echo.c
+++ b/source3/torture/test_async_echo.c
@@ -20,6 +20,7 @@
#include "includes.h"
#include "torture/proto.h"
#include "libsmb/libsmb.h"
+#include "async_smb.h"
#include "rpc_client/cli_pipe.h"
#include "librpc/gen_ndr/ndr_echo_c.h"
@@ -100,6 +101,15 @@ bool run_async_echo(int dummy)
tevent_req_set_callback(req, rpccli_sleep_done, &num_reqs);
num_reqs += 1;
+ /* Wait until the rpc operation arrives at the smb layer */
+ while (tevent_req_is_in_progress(req) &&
+ !cli_has_async_calls(cli)) {
+ if (tevent_loop_once(ev) != 0) {
+ printf("tevent_loop_once failed\n");
+ goto fail;
+ }
+ }
+
req = cli_echo_send(ev, ev, cli, 1, data_blob_const("hello", 5));
if (req == NULL) {
printf("cli_echo_send failed\n");