From 99666e4a8dd2751b1d39f370e82caa912f7079a2 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 20 Sep 2011 04:43:05 +0200 Subject: s3:torture: avoid using read_smb() metze --- source3/torture/torture.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'source3') diff --git a/source3/torture/torture.c b/source3/torture/torture.c index 1e0983a5e1..d70065aef7 100644 --- a/source3/torture/torture.c +++ b/source3/torture/torture.c @@ -234,6 +234,8 @@ static bool cli_bad_session_request(int fd, bool ret = false; uint8_t message_type; uint8_t error; + struct event_context *ev; + struct tevent_req *req; frame = talloc_stackframe(); @@ -279,11 +281,24 @@ static bool cli_bad_session_request(int fd, if (len == -1) { goto fail; } - len = read_smb(fd, talloc_tos(), &inbuf, &err); + + ev = event_context_init(frame); + if (ev == NULL) { + goto fail; + } + req = read_smb_send(frame, ev, fd); + if (req == NULL) { + goto fail; + } + if (!tevent_req_poll(req, ev)) { + goto fail; + } + len = read_smb_recv(req, talloc_tos(), &inbuf, &err); if (len == -1) { errno = err; goto fail; } + TALLOC_FREE(ev); message_type = CVAL(inbuf, 0); if (message_type != 0x83) { -- cgit