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)
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,
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