mirror of
https://github.com/moparisthebest/curl
synced 2024-08-13 17:03:50 -04:00
smtp: Updated the coding style for state changes after a send operation
Some state changes would be performed after a failure test that performed a hard return, whilst others would be performed within a test for success. Updated the code, for consistency, so all instances are performed within a success test.
This commit is contained in:
parent
757aa7b09d
commit
036366f1ef
28
lib/smtp.c
28
lib/smtp.c
@ -343,12 +343,10 @@ static CURLcode smtp_state_ehlo(struct connectdata *conn)
|
|||||||
/* Send the EHLO command */
|
/* Send the EHLO command */
|
||||||
result = Curl_pp_sendf(&smtpc->pp, "EHLO %s", smtpc->domain);
|
result = Curl_pp_sendf(&smtpc->pp, "EHLO %s", smtpc->domain);
|
||||||
|
|
||||||
if(result)
|
if(!result)
|
||||||
return result;
|
state(conn, SMTP_EHLO);
|
||||||
|
|
||||||
state(conn, SMTP_EHLO);
|
return result;
|
||||||
|
|
||||||
return CURLE_OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static CURLcode smtp_state_helo(struct connectdata *conn)
|
static CURLcode smtp_state_helo(struct connectdata *conn)
|
||||||
@ -362,12 +360,10 @@ static CURLcode smtp_state_helo(struct connectdata *conn)
|
|||||||
/* Send the HELO command */
|
/* Send the HELO command */
|
||||||
result = Curl_pp_sendf(&smtpc->pp, "HELO %s", smtpc->domain);
|
result = Curl_pp_sendf(&smtpc->pp, "HELO %s", smtpc->domain);
|
||||||
|
|
||||||
if(result)
|
if(!result)
|
||||||
return result;
|
state(conn, SMTP_HELO);
|
||||||
|
|
||||||
state(conn, SMTP_HELO);
|
return result;
|
||||||
|
|
||||||
return CURLE_OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static CURLcode smtp_state_starttls(struct connectdata *conn)
|
static CURLcode smtp_state_starttls(struct connectdata *conn)
|
||||||
@ -996,10 +992,8 @@ static CURLcode smtp_mail(struct connectdata *conn)
|
|||||||
Curl_safefree(auth);
|
Curl_safefree(auth);
|
||||||
Curl_safefree(size);
|
Curl_safefree(size);
|
||||||
|
|
||||||
if(result)
|
if(!result)
|
||||||
return result;
|
state(conn, SMTP_MAIL);
|
||||||
|
|
||||||
state(conn, SMTP_MAIL);
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -1077,10 +1071,8 @@ static CURLcode smtp_state_rcpt_resp(struct connectdata *conn, int smtpcode,
|
|||||||
/* Send the DATA command */
|
/* Send the DATA command */
|
||||||
result = Curl_pp_sendf(&conn->proto.smtpc.pp, "DATA");
|
result = Curl_pp_sendf(&conn->proto.smtpc.pp, "DATA");
|
||||||
|
|
||||||
if(result)
|
if(!result)
|
||||||
return result;
|
state(conn, SMTP_DATA);
|
||||||
|
|
||||||
state(conn, SMTP_DATA);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
Loading…
Reference in New Issue
Block a user