smtp_server_recipient_destroy(&data->rcpt);
}
-static bool
-cmd_rcpt_check_state(struct smtp_server_cmd_ctx *cmd)
+static bool cmd_rcpt_check_state(struct smtp_server_cmd_ctx *cmd)
{
struct smtp_server_connection *conn = cmd->conn;
struct smtp_server_transaction *trans = conn->state.trans;
if (!smtp_server_command_replied_success(command)) {
conn->state.denied_rcpt_cmds++;
- /* failure; substitute our own error if predictable */
+ /* Failure; substitute our own error if predictable */
if (smtp_server_command_reply_is_forwarded(command))
(void)cmd_rcpt_check_state(cmd);
return;
}
- /* success */
+ /* Success */
data->rcpt = NULL; /* clear to prevent destruction */
(void)smtp_server_recipient_approved(&rcpt);
}
i_assert(conn->state.pending_mail_cmds == 0);
- /* all preceeding commands have finished and now the transaction state
+ /* All preceeding commands have finished and now the transaction state
is clear. This provides the opportunity to re-check the transaction
state and abort the pending proxied mail command if it is bound to
fail */
Forward-path = Path
*/
- /* check transaction state as far as possible */
+ /* Check transaction state as far as possible */
if (!cmd_rcpt_check_state(cmd))
return;
cmd_rcpt_completed, rcpt_data);
smtp_server_command_add_hook(command, SMTP_SERVER_COMMAND_HOOK_DESTROY,
cmd_rcpt_destroy, rcpt_data);
-
+
conn->state.pending_rcpt_cmds++;
smtp_server_command_ref(command);
i_assert(callbacks != NULL && callbacks->conn_cmd_rcpt != NULL);
- if ((ret=callbacks->conn_cmd_rcpt(conn->context, cmd, rcpt)) <= 0) {
+ ret = callbacks->conn_cmd_rcpt(conn->context, cmd, rcpt);
+ if (ret <= 0) {
i_assert(ret == 0 || smtp_server_command_is_replied(command));
- /* command is waiting for external event or it failed */
+ /* Command is waiting for external event or it failed */
smtp_server_command_unref(&command);
return;
}
if (!smtp_server_command_is_replied(command)) {
- /* set generic RCPT success reply if none is provided */
+ /* Set generic RCPT success reply if none is provided */
smtp_server_cmd_rcpt_reply_success(cmd);
}
smtp_server_command_unref(&command);