From 6ba8c105c541636ee79e20eb7c5547ed6d8117e2 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 9 Sep 2008 14:37:17 +0200 Subject: Add utility function cli_in_chain() This gives a hint whether a function is called from within the middle of a chain. In particular the trans calls don't really like this. (This used to be commit 4252b32db5ef7483f2c5c52312b6e6dc68d1d687) --- source3/libsmb/async_smb.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'source3/libsmb/async_smb.c') 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 @@ -136,6 +136,21 @@ static int cli_request_destructor(struct cli_request *req) return 0; } +/** + * 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 -- cgit