NTSTATUS smbd_smb2_request_verify_sizes(struct smbd_smb2_request *req,
size_t expected_body_size);
+void smb2_request_set_async_internal(struct smbd_smb2_request *req,
+ bool async_internal);
+
enum protocol_types smbd_smb2_protocol_dialect_match(const uint8_t *indyn,
const int dialect_count,
uint16_t *dialect);
struct tevent_timer *async_te;
bool compound_related;
+ /*
+ * Give the implementation of an SMB2 req a way to tell the SMB2 request
+ * processing engine that the internal request is going async, while
+ * preserving synchronous SMB2 behaviour.
+ */
+ bool async_internal;
+
/*
* the encryption key for the whole
* compound chain
return 0;
}
+void smb2_request_set_async_internal(struct smbd_smb2_request *req,
+ bool async_internal)
+{
+ req->async_internal = async_internal;
+}
+
static struct smbd_smb2_request *smbd_smb2_request_allocate(TALLOC_CTX *mem_ctx)
{
TALLOC_CTX *mem_pool;
return NT_STATUS_OK;
}
+ if (req->async_internal) {
+ /*
+ * An SMB2 request implementation wants to handle the request
+ * asynchronously "internally" while keeping synchronous
+ * behaviour for the SMB2 request. This means we don't send an
+ * interim response and we can allow processing of compound SMB2
+ * requests (cf the subsequent check) for all cases.
+ */
+ return NT_STATUS_OK;
+ }
+
if (req->in.vector_count > req->current_idx + SMBD_SMB2_NUM_IOV_PER_REQ) {
/*
* We're trying to go async in a compound request
encryption_required = x->global->encryption_flags & SMBXSRV_ENCRYPTION_REQUIRED;
}
+ req->async_internal = false;
req->do_signing = false;
req->do_encryption = false;
req->was_encrypted = false;