]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-smtp: server: Add smtp_server_command_get_reply_count().
authorStephan Bosch <stephan.bosch@dovecot.fi>
Sun, 14 Oct 2018 12:23:32 +0000 (14:23 +0200)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Tue, 12 Feb 2019 13:41:14 +0000 (15:41 +0200)
Returns the number of replies expected to the command.

src/lib-smtp/smtp-server-command.c
src/lib-smtp/smtp-server.h

index aeb097d0cc2e203cf4dd6067b76654f92ecb1d57..1c0e526e463458c363ba7885bc2d9c44b602df05 100644 (file)
@@ -387,6 +387,13 @@ void smtp_server_command_set_reply_count(struct smtp_server_command *cmd,
        cmd->replies_expected = count;
 }
 
+unsigned int
+smtp_server_command_get_reply_count(struct smtp_server_command *cmd)
+{
+       i_assert(cmd->replies_expected > 0);
+       return cmd->replies_expected;
+}
+
 void smtp_server_command_ready_to_reply(struct smtp_server_command *cmd)
 {
        cmd->state = SMTP_SERVER_COMMAND_STATE_READY_TO_REPLY;
index e632ab40f391001ba03951136126bb8e6ac36241..957d41fd5f0bbd190a768b3dae798e5eb88119b8 100644 (file)
@@ -502,6 +502,8 @@ void smtp_server_command_unregister(struct smtp_server *server,
 
 void smtp_server_command_set_reply_count(struct smtp_server_command *cmd,
                                         unsigned int count);
+unsigned int
+smtp_server_command_get_reply_count(struct smtp_server_command *cmd);
 
 void smtp_server_command_fail(struct smtp_server_command *cmd,
                              unsigned int status, const char *enh_code,