]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:smb2_server: make use of SMBD_SMB2_OUT_*_IOV smbd_smb2_request_reply()
authorStefan Metzmacher <metze@samba.org>
Tue, 7 Aug 2012 10:55:28 +0000 (12:55 +0200)
committerStefan Metzmacher <metze@samba.org>
Tue, 7 Aug 2012 16:32:46 +0000 (18:32 +0200)
metze

source3/smbd/smb2_server.c

index aa69705ef04784dca96531d78a30f4b39ab48fd7..acc998bfd0a37ce16d02d1f153ccd57ef6023e6f 100644 (file)
@@ -1979,7 +1979,8 @@ NTSTATUS smbd_smb2_request_dispatch(struct smbd_smb2_request *req)
 static NTSTATUS smbd_smb2_request_reply(struct smbd_smb2_request *req)
 {
        struct tevent_req *subreq;
-       int i = req->current_idx;
+       struct iovec *outhdr = SMBD_SMB2_OUT_HDR_IOV(req);
+       struct iovec *outdyn = SMBD_SMB2_OUT_DYN_IOV(req);
 
        req->subreq = NULL;
        TALLOC_FREE(req->async_te);
@@ -2024,7 +2025,7 @@ static NTSTATUS smbd_smb2_request_reply(struct smbd_smb2_request *req)
 
                status = smb2_signing_sign_pdu(signing_key,
                                               conn->protocol,
-                                              &req->out.vector[i],
+                                              outhdr,
                                               SMBD_SMB2_NUM_IOV_PER_REQ);
                if (!NT_STATUS_IS_OK(status)) {
                        return status;
@@ -2038,8 +2039,7 @@ static NTSTATUS smbd_smb2_request_reply(struct smbd_smb2_request *req)
 
        /* I am a sick, sick man... :-). Sendfile hack ... JRA. */
        if (req->out.vector_count == 4 &&
-                       req->out.vector[3].iov_base == NULL &&
-                       req->out.vector[3].iov_len != 0) {
+           outdyn->iov_base == NULL && outdyn->iov_len != 0) {
                /* Dynamic part is NULL. Chop it off,
                   We're going to send it via sendfile. */
                req->out.vector_count -= 1;