summaryrefslogtreecommitdiff
path: root/libcli
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-11-18 10:28:40 +0100
committerStefan Metzmacher <metze@samba.org>2011-11-24 19:02:30 +0100
commit4d8e1517798577d55479629d01826583a02aa43a (patch)
treeb6afc378fa6726318ec5b2957b0468ad34ab2193 /libcli
parente2912fa853321461d9b0a24e5015e82e3f5a7c18 (diff)
downloadsamba-4d8e1517798577d55479629d01826583a02aa43a.tar.gz
samba-4d8e1517798577d55479629d01826583a02aa43a.tar.bz2
samba-4d8e1517798577d55479629d01826583a02aa43a.zip
smbXcli: simplify smb1cli_req_chain_submit()
We should hang everything on the first request in the chain, as that's the one that gets added to the pending array. metze
Diffstat (limited to 'libcli')
-rw-r--r--libcli/smb/smbXcli_base.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/libcli/smb/smbXcli_base.c b/libcli/smb/smbXcli_base.c
index 302f6d219d..ae14ad7daa 100644
--- a/libcli/smb/smbXcli_base.c
+++ b/libcli/smb/smbXcli_base.c
@@ -1671,9 +1671,6 @@ NTSTATUS smb1cli_req_chain_submit(struct tevent_req **reqs, int num_reqs)
struct smbXcli_req_state *first_state =
tevent_req_data(reqs[0],
struct smbXcli_req_state);
- struct smbXcli_req_state *last_state =
- tevent_req_data(reqs[num_reqs-1],
- struct smbXcli_req_state);
struct smbXcli_req_state *state;
size_t wct_offset;
size_t chain_padding = 0;
@@ -1719,13 +1716,13 @@ NTSTATUS smb1cli_req_chain_submit(struct tevent_req **reqs, int num_reqs)
iovlen += state->smb1.iov_count - 2;
}
- iov = talloc_zero_array(last_state, struct iovec, iovlen);
+ iov = talloc_zero_array(first_state, struct iovec, iovlen);
if (iov == NULL) {
return NT_STATUS_NO_MEMORY;
}
first_state->smb1.chained_requests = (struct tevent_req **)talloc_memdup(
- last_state, reqs, sizeof(*reqs) * num_reqs);
+ first_state, reqs, sizeof(*reqs) * num_reqs);
if (first_state->smb1.chained_requests == NULL) {
TALLOC_FREE(iov);
return NT_STATUS_NO_MEMORY;
@@ -1810,19 +1807,13 @@ NTSTATUS smb1cli_req_chain_submit(struct tevent_req **reqs, int num_reqs)
return NT_STATUS_INVALID_PARAMETER_MIX;
}
- status = smb1cli_req_writev_submit(reqs[0], last_state, iov, iovlen);
+ status = smb1cli_req_writev_submit(reqs[0], first_state, iov, iovlen);
if (!NT_STATUS_IS_OK(status)) {
TALLOC_FREE(iov);
TALLOC_FREE(first_state->smb1.chained_requests);
return status;
}
- for (i=0; i < (num_reqs - 1); i++) {
- state = tevent_req_data(reqs[i], struct smbXcli_req_state);
-
- state->smb1.seqnum = last_state->smb1.seqnum;
- }
-
return NT_STATUS_OK;
}