summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2010-03-05 15:22:10 +0100
committerStefan Metzmacher <metze@samba.org>2010-03-07 16:52:36 +0100
commit2450fc1c271b9f944455370510062164e68a8d59 (patch)
treeae0030b2fa07948601f720ba3d411c2bbb51385b /source4/torture
parentcb4f2699453b8092be0c0ff42fa0f31582d38da5 (diff)
downloadsamba-2450fc1c271b9f944455370510062164e68a8d59.tar.gz
samba-2450fc1c271b9f944455370510062164e68a8d59.tar.bz2
samba-2450fc1c271b9f944455370510062164e68a8d59.zip
s4:libcli/wrepl: implement wrepl_request_send as a tevent_req based wrapper
metze
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/nbt/winsreplication.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c
index 1655135a33..9a7be03199 100644
--- a/source4/torture/nbt/winsreplication.c
+++ b/source4/torture/nbt/winsreplication.c
@@ -83,7 +83,7 @@ static const char *wrepl_name_state_string(enum wrepl_name_state state)
static bool test_assoc_ctx1(struct torture_context *tctx)
{
bool ret = true;
- struct wrepl_request *req;
+ struct tevent_req *subreq;
struct wrepl_socket *wrepl_socket1;
struct wrepl_associate associate1;
struct wrepl_socket *wrepl_socket2;
@@ -95,6 +95,7 @@ static bool test_assoc_ctx1(struct torture_context *tctx)
NTSTATUS status;
struct nbt_name name;
const char *address;
+ bool ok;
if (!torture_nbt_get_name(tctx, &name, &address))
return false;
@@ -131,8 +132,13 @@ static bool test_assoc_ctx1(struct torture_context *tctx)
packet.message.replication.command = WREPL_REPL_TABLE_QUERY;
ZERO_STRUCT(ctrl);
ctrl.send_only = true;
- req = wrepl_request_send(wrepl_socket2, &packet, &ctrl);
- status = wrepl_request_recv(req, tctx, &rep_packet);
+ subreq = wrepl_request_send(tctx, tctx->ev, wrepl_socket2, &packet, &ctrl);
+ ok = tevent_req_poll(subreq, tctx->ev);
+ if (!ok) {
+ CHECK_STATUS(tctx, NT_STATUS_INTERNAL_ERROR, NT_STATUS_OK);
+ }
+ status = wrepl_request_recv(subreq, tctx, &rep_packet);
+ TALLOC_FREE(subreq);
CHECK_STATUS(tctx, status, NT_STATUS_OK);
torture_comment(tctx, "Send a association request (conn2), to make sure the last request was ignored\n");