From 560e4b1b32f56ed4cfffc60efd9199ed435409ba Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 29 Aug 2019 10:28:14 +0000 Subject: [PATCH] libcli/smb: add smbXcli_conn_send_queue() This is useful in order to test async requests tevent_queue_wait_send/recv() can be used to block the queue between requests or wait for the queue to be flushed. Signed-off-by: Stefan Metzmacher Reviewed-by: Jeremy Allison --- libcli/smb/smbXcli_base.c | 5 +++++ libcli/smb/smbXcli_base.h | 1 + 2 files changed, 6 insertions(+) diff --git a/libcli/smb/smbXcli_base.c b/libcli/smb/smbXcli_base.c index df80be6bf16..0fc4aa4451a 100644 --- a/libcli/smb/smbXcli_base.c +++ b/libcli/smb/smbXcli_base.c @@ -2743,6 +2743,11 @@ NTSTATUS smb1cli_req_chain_submit(struct tevent_req **reqs, int num_reqs) return NT_STATUS_OK; } +struct tevent_queue *smbXcli_conn_send_queue(struct smbXcli_conn *conn) +{ + return conn->outgoing; +} + bool smbXcli_conn_has_async_calls(struct smbXcli_conn *conn) { return ((tevent_queue_length(conn->outgoing) != 0) diff --git a/libcli/smb/smbXcli_base.h b/libcli/smb/smbXcli_base.h index db5f5d58799..d9c3175bdf5 100644 --- a/libcli/smb/smbXcli_base.h +++ b/libcli/smb/smbXcli_base.h @@ -43,6 +43,7 @@ struct smbXcli_conn *smbXcli_conn_create(TALLOC_CTX *mem_ctx, bool smbXcli_conn_is_connected(struct smbXcli_conn *conn); void smbXcli_conn_disconnect(struct smbXcli_conn *conn, NTSTATUS status); +struct tevent_queue *smbXcli_conn_send_queue(struct smbXcli_conn *conn); bool smbXcli_conn_has_async_calls(struct smbXcli_conn *conn); bool smbXcli_conn_dfs_supported(struct smbXcli_conn *conn);