The condition is amended with (state < SMTP_CLIENT_COMMAND_STATE_FINISHED),
because that part is now checked after the intiialization of this variable
(causing the function to exit). It is important that the content of this
variable makes sense immediately (for future changes), rather than only after
the if statement that checks the added condition.
bool was_locked =
(state >= SMTP_CLIENT_COMMAND_STATE_SUBMITTED) &&
(cmd->locked || cmd->plug);
+ bool was_sent =
+ (!disconnected && state > SMTP_CLIENT_COMMAND_STATE_SUBMITTED &&
+ state < SMTP_CLIENT_COMMAND_STATE_FINISHED);
*_cmd = NULL;
state >= SMTP_CLIENT_COMMAND_STATE_FINISHED)
return;
- if (disconnected || state <= SMTP_CLIENT_COMMAND_STATE_SUBMITTED) {
+ if (!was_sent) {
e_debug(cmd->event, "Abort");
cmd->state = SMTP_CLIENT_COMMAND_STATE_ABORTED;
} else {