&cmd, SMTP_SERVER_COMMAND_HOOK_DESTROY, TRUE))
i_unreached();
+ smtp_server_command_pipeline_unblock(&cmd->context);
+
smtp_server_reply_free(cmd);
event_unref(&cmd->context.event);
pool_unref(&cmd->context.pool);
}
smtp_server_reply_free(cmd);
+ smtp_server_command_pipeline_unblock(&cmd->context);
smtp_server_command_unref(_cmd);
}
e_debug(cmd->context.event, "Completed");
+ if (cmd->pipeline_blocked)
+ smtp_server_command_pipeline_unblock(&cmd->context);
+
return smtp_server_command_call_hooks(
_cmd, SMTP_SERVER_COMMAND_HOOK_COMPLETED, TRUE);
}
}
smtp_server_command_unref(&cmd);
return;
- } else if (cmd->input_locked) {
- smtp_server_command_input_unlock(&cmd->context);
}
+ if (cmd->input_locked)
+ smtp_server_command_input_unlock(&cmd->context);
+ if (cmd->pipeline_blocked)
+ smtp_server_command_pipeline_unblock(&cmd->context);
smtp_server_command_unref(&cmd);
smtp_server_connection_trigger_output(conn);
command->input_locked = TRUE;
command->input_captured = TRUE;
}
+
+void smtp_server_command_pipeline_block(struct smtp_server_cmd_ctx *cmd)
+{
+ struct smtp_server_command *command = cmd->cmd;
+ struct smtp_server_connection *conn = cmd->conn;
+
+ e_debug(cmd->event, "Pipeline blocked");
+
+ command->pipeline_blocked = TRUE;
+ smtp_server_connection_input_lock(conn);
+}
+
+void smtp_server_command_pipeline_unblock(struct smtp_server_cmd_ctx *cmd)
+{
+ struct smtp_server_command *command = cmd->cmd;
+ struct smtp_server_connection *conn = cmd->conn;
+
+ if (!command->pipeline_blocked)
+ return;
+
+ command->pipeline_blocked = FALSE;
+ smtp_server_connection_input_unlock(conn);
+
+ e_debug(cmd->event, "Pipeline unblocked");
+}