summaryrefslogtreecommitdiffstats
path: root/src/ctrl
diff options
context:
space:
mode:
Diffstat (limited to 'src/ctrl')
-rw-r--r--src/ctrl/control_cmd.c1
-rw-r--r--src/ctrl/control_if.c7
2 files changed, 8 insertions, 0 deletions
diff --git a/src/ctrl/control_cmd.c b/src/ctrl/control_cmd.c
index c747e84d..fb0cd2b7 100644
--- a/src/ctrl/control_cmd.c
+++ b/src/ctrl/control_cmd.c
@@ -566,6 +566,7 @@ ctrl_cmd_def_make(const void *ctx, struct ctrl_cmd *cmd, void *data, unsigned in
cd = talloc_zero(ctx, struct ctrl_cmd_def);
+ cmd->defer = cd;
cd->cmd = cmd;
cd->data = data;
diff --git a/src/ctrl/control_if.c b/src/ctrl/control_if.c
index 07de0d46..df8abbc6 100644
--- a/src/ctrl/control_if.c
+++ b/src/ctrl/control_if.c
@@ -401,6 +401,13 @@ int ctrl_handle_msg(struct ctrl_handle *ctrl, struct ctrl_connection *ccon, stru
if (cmd->type != CTRL_TYPE_ERROR) {
cmd->ccon = ccon;
if (ctrl_cmd_handle(ctrl, cmd, ctrl->data) == CTRL_CMD_HANDLED) {
+
+ if (cmd->defer) {
+ /* The command is still stored as ctrl_cmd_def.cmd, in the def_cmds list.
+ * Just leave hanging for deferred handling. Reply will happen later. */
+ return 0;
+ }
+
/* On CTRL_CMD_HANDLED, no reply needs to be sent back. */
talloc_free(cmd);
cmd = NULL;