From 271f78a9bb814ed10bcc8883a60d6609e1eef500 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 31 Aug 2011 00:40:06 +0200 Subject: s3:smb2cli: pass an array of expected status/body_size pairs to smb2cli_req_recv() This gives the caller more control and correctly reports unexpected errors to the caller, instead of return NT_STATUS_INVALID_NETWOR_RESPONSE metze --- source3/libsmb/smb2cli_read.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'source3/libsmb/smb2cli_read.c') diff --git a/source3/libsmb/smb2cli_read.c b/source3/libsmb/smb2cli_read.c index e45a75f6ca..7e2b53471b 100644 --- a/source3/libsmb/smb2cli_read.c +++ b/source3/libsmb/smb2cli_read.c @@ -89,8 +89,19 @@ static void smb2cli_read_done(struct tevent_req *subreq) NTSTATUS status; struct iovec *iov; uint8_t data_offset; + static const struct smb2cli_req_expected_response expected[] = { + { + .status = STATUS_BUFFER_OVERFLOW, + .body_size = 0x11 + }, + { + .status = NT_STATUS_OK, + .body_size = 0x11 + } + }; - status = smb2cli_req_recv(subreq, state, &iov, 17); + status = smb2cli_req_recv(subreq, state, &iov, + expected, ARRAY_SIZE(expected)); if (tevent_req_nterror(req, status)) { return; } -- cgit