libcli/smb: pass max_dyn_len to smb2cli_req_create()
authorStefan Metzmacher <metze@samba.org>
Tue, 13 Aug 2013 07:54:42 +0000 (09:54 +0200)
committerStefan Metzmacher <metze@samba.org>
Thu, 15 Aug 2013 07:07:06 +0000 (09:07 +0200)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
libcli/smb/smbXcli_base.c
libcli/smb/smbXcli_base.h

index 7d7df144f7e7ecf27af2908e93851e5134e6737b..02716914557ad9a771e8b6f37ae129a89a9579de 100644 (file)
@@ -2495,7 +2495,7 @@ static bool smb2cli_req_cancel(struct tevent_req *req)
                                    0, /* timeout */
                                    tcon, session,
                                    fixed, fixed_len,
-                                   NULL, 0);
+                                   NULL, 0, 0);
        if (subreq == NULL) {
                return false;
        }
@@ -2544,7 +2544,8 @@ struct tevent_req *smb2cli_req_create(TALLOC_CTX *mem_ctx,
                                      const uint8_t *fixed,
                                      uint16_t fixed_len,
                                      const uint8_t *dyn,
-                                     uint32_t dyn_len)
+                                     uint32_t dyn_len,
+                                     uint32_t max_dyn_len)
 {
        struct tevent_req *req;
        struct smbXcli_req_state *state;
@@ -2617,6 +2618,7 @@ struct tevent_req *smb2cli_req_create(TALLOC_CTX *mem_ctx,
        state->smb2.fixed_len = fixed_len;
        state->smb2.dyn = dyn;
        state->smb2.dyn_len = dyn_len;
+       state->smb2.max_dyn_len = max_dyn_len;
 
        if (state->smb2.should_encrypt) {
                SIVAL(state->smb2.transform, SMB2_TF_PROTOCOL_ID, SMB2_TF_MAGIC);
@@ -2986,12 +2988,15 @@ struct tevent_req *smb2cli_req_send(TALLOC_CTX *mem_ctx,
 {
        struct tevent_req *req;
        NTSTATUS status;
+       uint32_t max_dyn_len = 0;
 
        req = smb2cli_req_create(mem_ctx, ev, conn, cmd,
                                 additional_flags, clear_flags,
                                 timeout_msec,
                                 tcon, session,
-                                fixed, fixed_len, dyn, dyn_len);
+                                fixed, fixed_len,
+                                dyn, dyn_len,
+                                max_dyn_len);
        if (req == NULL) {
                return NULL;
        }
index a497e1376f9fe152cafe22cecc7e485bfff1763a..017c0f059d51d3bd70f8637678ec0f764cb03959 100644 (file)
@@ -218,7 +218,8 @@ struct tevent_req *smb2cli_req_create(TALLOC_CTX *mem_ctx,
                                      const uint8_t *fixed,
                                      uint16_t fixed_len,
                                      const uint8_t *dyn,
-                                     uint32_t dyn_len);
+                                     uint32_t dyn_len,
+                                     uint32_t max_dyn_len);
 void smb2cli_req_set_notify_async(struct tevent_req *req);
 NTSTATUS smb2cli_req_compound_submit(struct tevent_req **reqs,
                                     int num_reqs);