From 0cf64cf8f1ef0cda91a8fa6a9772afbdda23f4dd Mon Sep 17 00:00:00 2001 From: Stephan Bosch Date: Fri, 11 Sep 2020 22:40:31 +0200 Subject: [PATCH] lib-smtp: Reformat smtp-server-cmd-helo.c. --- src/lib-smtp/smtp-server-cmd-helo.c | 40 ++++++++++++++--------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/lib-smtp/smtp-server-cmd-helo.c b/src/lib-smtp/smtp-server-cmd-helo.c index 7681f6a78a..54b344bb07 100644 --- a/src/lib-smtp/smtp-server-cmd-helo.c +++ b/src/lib-smtp/smtp-server-cmd-helo.c @@ -18,14 +18,14 @@ cmd_helo_completed(struct smtp_server_cmd_ctx *cmd, i_assert(smtp_server_command_is_replied(command)); if (!smtp_server_command_replied_success(command)) { - /* failure */ + /* Failure */ return; } if (conn->pending_helo == &data->helo) conn->pending_helo = NULL; - /* success */ + /* Success */ smtp_server_connection_reset_state(conn); i_free(conn->helo_domain); @@ -42,9 +42,9 @@ cmd_helo_next(struct smtp_server_cmd_ctx *cmd, struct smtp_server_connection *conn = cmd->conn; if (conn->helo.domain == NULL || - strcmp(conn->helo.domain, data->helo.domain) != 0 || - conn->helo.old_smtp != data->helo.old_smtp) - data->changed = TRUE; /* definitive assessment */ + strcmp(conn->helo.domain, data->helo.domain) != 0 || + conn->helo.old_smtp != data->helo.old_smtp) + data->changed = TRUE; /* Definitive assessment */ } static void @@ -59,7 +59,7 @@ smtp_server_cmd_helo_run(struct smtp_server_cmd_ctx *cmd, const char *params, const char *domain = NULL; int ret; - /* parse domain argument */ + /* Parse domain argument */ if (*params == '\0') { smtp_server_reply(cmd, 501, "", "Missing hostname"); @@ -83,46 +83,46 @@ smtp_server_cmd_helo_run(struct smtp_server_cmd_ctx *cmd, const char *params, if (conn->helo.domain == NULL || (domain != NULL && strcmp(conn->helo.domain, domain) != 0) || conn->helo.old_smtp != old_smtp) - helo_data->changed = TRUE; /* preliminary assessment */ + helo_data->changed = TRUE; /* Preliminary assessment */ if (conn->pending_helo == NULL) conn->pending_helo = &helo_data->helo; - smtp_server_command_add_hook(command, SMTP_SERVER_COMMAND_HOOK_NEXT, - cmd_helo_next, helo_data); - smtp_server_command_add_hook(command, SMTP_SERVER_COMMAND_HOOK_COMPLETED, - cmd_helo_completed, helo_data); + smtp_server_command_add_hook( + command, SMTP_SERVER_COMMAND_HOOK_NEXT, + cmd_helo_next, helo_data); + smtp_server_command_add_hook( + command, SMTP_SERVER_COMMAND_HOOK_COMPLETED, + cmd_helo_completed, helo_data); smtp_server_command_ref(command); if (callbacks != NULL && callbacks->conn_cmd_helo != NULL) { - /* specific implementation of EHLO command */ - if ((ret=callbacks->conn_cmd_helo(conn->context, - cmd, helo_data)) <= 0) { + /* Specific implementation of EHLO command */ + ret = callbacks->conn_cmd_helo(conn->context, cmd, helo_data); + 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)) { - /* submit default EHLO reply if none is provided */ + /* Submit default EHLO reply if none is provided */ smtp_server_cmd_ehlo_reply_default(cmd); } smtp_server_command_unref(&command); } -void smtp_server_cmd_ehlo(struct smtp_server_cmd_ctx *cmd, - const char *params) +void smtp_server_cmd_ehlo(struct smtp_server_cmd_ctx *cmd, const char *params) { /* ehlo = "EHLO" SP ( Domain / address-literal ) CRLF */ smtp_server_cmd_helo_run(cmd, params, FALSE); } -void smtp_server_cmd_helo(struct smtp_server_cmd_ctx *cmd, - const char *params) +void smtp_server_cmd_helo(struct smtp_server_cmd_ctx *cmd, const char *params) { /* helo = "HELO" SP Domain CRLF */ -- 2.47.3