diff options
author | Steve Holme <steve_holme@hotmail.com> | 2013-03-03 13:48:22 +0000 |
---|---|---|
committer | Steve Holme <steve_holme@hotmail.com> | 2013-03-03 13:48:22 +0000 |
commit | 036366f1ef25eb795cf743eb67f8767ec8cdb22d (patch) | |
tree | 5ef82c3620c4c9d29d68ac304ed038d724dd4795 | |
parent | 757aa7b09d37cc5ad32a549c5ead0096bc4df28b (diff) |
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.
-rw-r--r-- | lib/smtp.c | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/lib/smtp.c b/lib/smtp.c index 006d22094..c4558646f 100644 --- a/lib/smtp.c +++ b/lib/smtp.c @@ -343,12 +343,10 @@ static CURLcode smtp_state_ehlo(struct connectdata *conn) /* Send the EHLO command */ result = Curl_pp_sendf(&smtpc->pp, "EHLO %s", smtpc->domain); - if(result) - return result; - - state(conn, SMTP_EHLO); + if(!result) + state(conn, SMTP_EHLO); - return CURLE_OK; + return result; } static CURLcode smtp_state_helo(struct connectdata *conn) @@ -362,12 +360,10 @@ static CURLcode smtp_state_helo(struct connectdata *conn) /* Send the HELO command */ result = Curl_pp_sendf(&smtpc->pp, "HELO %s", smtpc->domain); - if(result) - return result; - - state(conn, SMTP_HELO); + if(!result) + state(conn, SMTP_HELO); - return CURLE_OK; + return result; } static CURLcode smtp_state_starttls(struct connectdata *conn) @@ -996,10 +992,8 @@ static CURLcode smtp_mail(struct connectdata *conn) Curl_safefree(auth); Curl_safefree(size); - if(result) - return result; - - state(conn, SMTP_MAIL); + if(!result) + state(conn, SMTP_MAIL); return result; } @@ -1077,10 +1071,8 @@ static CURLcode smtp_state_rcpt_resp(struct connectdata *conn, int smtpcode, /* Send the DATA command */ result = Curl_pp_sendf(&conn->proto.smtpc.pp, "DATA"); - if(result) - return result; - - state(conn, SMTP_DATA); + if(!result) + state(conn, SMTP_DATA); } return result; |