summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/include/async_smb.h1
-rw-r--r--source3/libsmb/async_smb.c15
2 files changed, 16 insertions, 0 deletions
diff --git a/source3/include/async_smb.h b/source3/include/async_smb.h
index e9e10023e3..4e2061813f 100644
--- a/source3/include/async_smb.h
+++ b/source3/include/async_smb.h
@@ -124,6 +124,7 @@ struct async_req *cli_request_send(TALLOC_CTX *mem_ctx,
bool cli_chain_cork(struct cli_state *cli, struct event_context *ev,
size_t size_hint);
void cli_chain_uncork(struct cli_state *cli);
+bool cli_in_chain(struct cli_state *cli);
NTSTATUS cli_pull_reply(struct async_req *req,
uint8_t *pwct, uint16_t **pvwv,
diff --git a/source3/libsmb/async_smb.c b/source3/libsmb/async_smb.c
index 435c8c1cb9..c875acbe48 100644
--- a/source3/libsmb/async_smb.c
+++ b/source3/libsmb/async_smb.c
@@ -137,6 +137,21 @@ static int cli_request_destructor(struct cli_request *req)
}
/**
+ * Are there already requests waiting in the chain_accumulator?
+ * @param[in] cli The cli_state we want to check
+ * @retval reply :-)
+ */
+
+bool cli_in_chain(struct cli_state *cli)
+{
+ if (cli->chain_accumulator == NULL) {
+ return false;
+ }
+
+ return (cli->chain_accumulator->num_async != 0);
+}
+
+/**
* Is the SMB command able to hold an AND_X successor
* @param[in] cmd The SMB command in question
* @retval Can we add a chained request after "cmd"?