diff options
author | Steve Holme <steve_holme@hotmail.com> | 2013-11-23 09:35:35 +0000 |
---|---|---|
committer | Steve Holme <steve_holme@hotmail.com> | 2013-11-23 09:35:44 +0000 |
commit | 5ee64be9c6ca2bcf411801834ce39db196f68529 (patch) | |
tree | 26bae80f595d514e12f0457439e549b586da8a95 /lib/smtp.c | |
parent | 9f18cf15d5edc73b6a7b52364ff0a8240c216e98 (diff) | |
download | curl-5ee64be9c6ca2bcf411801834ce39db196f68529.tar.gz |
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().
Diffstat (limited to 'lib/smtp.c')
-rw-r--r-- | lib/smtp.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/smtp.c b/lib/smtp.c index aa3ff326a..711d3e09f 100644 --- a/lib/smtp.c +++ b/lib/smtp.c @@ -1319,7 +1319,6 @@ static CURLcode smtp_state_mail_resp(struct connectdata *conn, int smtpcode, if(smtpcode/100 != 2) { failf(data, "MAIL failed: %d", smtpcode); result = CURLE_SEND_ERROR; - state(conn, SMTP_STOP); } else /* Start the RCPT TO command */ @@ -1341,7 +1340,6 @@ static CURLcode smtp_state_rcpt_resp(struct connectdata *conn, int smtpcode, if(smtpcode/100 != 2) { failf(data, "RCPT failed: %d", smtpcode); result = CURLE_SEND_ERROR; - state(conn, SMTP_STOP); } else { smtp->rcpt = smtp->rcpt->next; @@ -1365,25 +1363,27 @@ static CURLcode smtp_state_rcpt_resp(struct connectdata *conn, int smtpcode, static CURLcode smtp_state_data_resp(struct connectdata *conn, int smtpcode, smtpstate instate) { + CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; (void)instate; /* no use for this yet */ if(smtpcode != 354) { - state(conn, SMTP_STOP); - return CURLE_SEND_ERROR; + failf(data, "DATA failed: %d", smtpcode); + result = CURLE_SEND_ERROR; } + else { + /* Set the progress upload size */ + Curl_pgrsSetUploadSize(data, data->set.infilesize); - /* Set the progress upload size */ - Curl_pgrsSetUploadSize(data, data->set.infilesize); - - /* SMTP upload */ - Curl_setup_transfer(conn, -1, -1, FALSE, NULL, FIRSTSOCKET, NULL); + /* SMTP upload */ + Curl_setup_transfer(conn, -1, -1, FALSE, NULL, FIRSTSOCKET, NULL); - /* End of DO phase */ - state(conn, SMTP_STOP); + /* End of DO phase */ + state(conn, SMTP_STOP); + } - return CURLE_OK; + return result; } /* For POSTDATA responses, which are received after the entire DATA |