From: Stephan Bosch Date: Sun, 14 Oct 2018 12:23:32 +0000 (+0200) Subject: lib-smtp: server: Add smtp_server_command_get_reply_count(). X-Git-Tag: 2.3.9~1193 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cb3e468add3cd19fd8c95b7e3f22b04166d3fd8c;p=thirdparty%2Fdovecot%2Fcore.git lib-smtp: server: Add smtp_server_command_get_reply_count(). Returns the number of replies expected to the command. --- diff --git a/src/lib-smtp/smtp-server-command.c b/src/lib-smtp/smtp-server-command.c index aeb097d0cc..1c0e526e46 100644 --- a/src/lib-smtp/smtp-server-command.c +++ b/src/lib-smtp/smtp-server-command.c @@ -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; diff --git a/src/lib-smtp/smtp-server.h b/src/lib-smtp/smtp-server.h index e632ab40f3..957d41fd5f 100644 --- a/src/lib-smtp/smtp-server.h +++ b/src/lib-smtp/smtp-server.h @@ -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,