]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-smtp: Reformat smtp-server-cmd-rcpt.c.
authorStephan Bosch <stephan.bosch@open-xchange.com>
Mon, 31 Aug 2020 12:13:31 +0000 (14:13 +0200)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Thu, 10 Sep 2020 12:43:56 +0000 (12:43 +0000)
src/lib-smtp/smtp-server-cmd-rcpt.c

index ebf9078ff325ba5c16540ed86d58fe98a867edfc..2be4f6aee440a5dc88ea86a7228094ae9be3ed54 100644 (file)
@@ -23,8 +23,7 @@ cmd_rcpt_destroy(struct smtp_server_cmd_ctx *cmd ATTR_UNUSED,
        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;
@@ -67,7 +66,7 @@ cmd_rcpt_completed(struct smtp_server_cmd_ctx *cmd,
        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);
 
@@ -76,7 +75,7 @@ cmd_rcpt_completed(struct smtp_server_cmd_ctx *cmd,
                return;
        }
 
-       /* success */
+       /* Success */
        data->rcpt = NULL; /* clear to prevent destruction */
        (void)smtp_server_recipient_approved(&rcpt);
 }
@@ -89,7 +88,7 @@ cmd_rcpt_recheck(struct smtp_server_cmd_ctx *cmd,
 
        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 */
@@ -125,7 +124,7 @@ void smtp_server_cmd_rcpt(struct smtp_server_cmd_ctx *cmd,
           Forward-path = Path
         */
 
-       /* check transaction state as far as possible */
+       /* Check transaction state as far as possible */
        if (!cmd_rcpt_check_state(cmd))
                return;
 
@@ -208,19 +207,20 @@ void smtp_server_cmd_rcpt(struct smtp_server_cmd_ctx *cmd,
                                     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);