libcli/smb: pass max_dyn_len to smb2cli_req_create()
[mat/samba.git] / libcli / smb / smbXcli_base.c
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;
        }