1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-15 22:15:13 -05:00

smtp: Post SMTP command expansion tidy up

Removed unnecessary SMTP_STOP state changes on failure.

Removed hard return on failure in smtp_state_data_resp().
This commit is contained in:
Steve Holme 2013-11-23 09:35:35 +00:00
parent 9f18cf15d5
commit 5ee64be9c6

View File

@ -1319,7 +1319,6 @@ static CURLcode smtp_state_mail_resp(struct connectdata *conn, int smtpcode,
if(smtpcode/100 != 2) { if(smtpcode/100 != 2) {
failf(data, "MAIL failed: %d", smtpcode); failf(data, "MAIL failed: %d", smtpcode);
result = CURLE_SEND_ERROR; result = CURLE_SEND_ERROR;
state(conn, SMTP_STOP);
} }
else else
/* Start the RCPT TO command */ /* Start the RCPT TO command */
@ -1341,7 +1340,6 @@ static CURLcode smtp_state_rcpt_resp(struct connectdata *conn, int smtpcode,
if(smtpcode/100 != 2) { if(smtpcode/100 != 2) {
failf(data, "RCPT failed: %d", smtpcode); failf(data, "RCPT failed: %d", smtpcode);
result = CURLE_SEND_ERROR; result = CURLE_SEND_ERROR;
state(conn, SMTP_STOP);
} }
else { else {
smtp->rcpt = smtp->rcpt->next; smtp->rcpt = smtp->rcpt->next;
@ -1365,15 +1363,16 @@ static CURLcode smtp_state_rcpt_resp(struct connectdata *conn, int smtpcode,
static CURLcode smtp_state_data_resp(struct connectdata *conn, int smtpcode, static CURLcode smtp_state_data_resp(struct connectdata *conn, int smtpcode,
smtpstate instate) smtpstate instate)
{ {
CURLcode result = CURLE_OK;
struct SessionHandle *data = conn->data; struct SessionHandle *data = conn->data;
(void)instate; /* no use for this yet */ (void)instate; /* no use for this yet */
if(smtpcode != 354) { if(smtpcode != 354) {
state(conn, SMTP_STOP); failf(data, "DATA failed: %d", smtpcode);
return CURLE_SEND_ERROR; result = CURLE_SEND_ERROR;
} }
else {
/* Set the progress upload size */ /* Set the progress upload size */
Curl_pgrsSetUploadSize(data, data->set.infilesize); Curl_pgrsSetUploadSize(data, data->set.infilesize);
@ -1382,8 +1381,9 @@ static CURLcode smtp_state_data_resp(struct connectdata *conn, int smtpcode,
/* End of DO phase */ /* End of DO phase */
state(conn, SMTP_STOP); state(conn, SMTP_STOP);
}
return CURLE_OK; return result;
} }
/* For POSTDATA responses, which are received after the entire DATA /* For POSTDATA responses, which are received after the entire DATA