* Reply
*/
-static void smtp_server_reply_clear(struct smtp_server_reply *reply)
+static void smtp_server_reply_destroy(struct smtp_server_reply *reply)
{
if (reply->command == NULL)
return;
str_free(&reply->content->text);
}
+static void smtp_server_reply_clear(struct smtp_server_reply *reply)
+{
+ smtp_server_reply_destroy(reply);
+ if (reply->submitted) {
+ i_assert(reply->command->replies_submitted > 0);
+ reply->command->replies_submitted--;
+ }
+ reply->submitted = FALSE;
+}
+
static struct smtp_server_reply *
smtp_server_reply_alloc(struct smtp_server_command *cmd, unsigned int index)
{
for (i = 0; i < cmd->replies_expected; i++) {
struct smtp_server_reply *reply =
array_idx_modifiable(&cmd->replies, i);
- smtp_server_reply_clear(reply);
+ smtp_server_reply_destroy(reply);
}
}