diff options
author | Stefan Metzmacher <metze@samba.org> | 2011-09-20 04:43:05 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2011-10-24 08:25:31 +0200 |
commit | 99666e4a8dd2751b1d39f370e82caa912f7079a2 (patch) | |
tree | 3a88a6916b65bc72e562fa5121eaf9c23adac363 /source3 | |
parent | 6b06b0d3b4971107b561a818c627a11021ef5812 (diff) | |
download | samba-99666e4a8dd2751b1d39f370e82caa912f7079a2.tar.gz samba-99666e4a8dd2751b1d39f370e82caa912f7079a2.tar.bz2 samba-99666e4a8dd2751b1d39f370e82caa912f7079a2.zip |
s3:torture: avoid using read_smb()
metze
Diffstat (limited to 'source3')
-rw-r--r-- | source3/torture/torture.c | 17 |
1 files changed, 16 insertions, 1 deletions
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) { |