diff options
author | Volker Lendecke <vl@sernet.de> | 2008-09-09 14:37:17 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2008-09-09 17:37:34 +0200 |
commit | 6ba8c105c541636ee79e20eb7c5547ed6d8117e2 (patch) | |
tree | 5c7742f58e858f6e591c3b9fa1ca7e2435175301 /source3/libsmb | |
parent | 6344b8ec27809950810024956161e041d6e83753 (diff) | |
download | samba-6ba8c105c541636ee79e20eb7c5547ed6d8117e2.tar.gz samba-6ba8c105c541636ee79e20eb7c5547ed6d8117e2.tar.bz2 samba-6ba8c105c541636ee79e20eb7c5547ed6d8117e2.zip |
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)
Diffstat (limited to 'source3/libsmb')
-rw-r--r-- | source3/libsmb/async_smb.c | 15 |
1 files changed, 15 insertions, 0 deletions
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"? |