if(smtpcode/100 != 2) {
failf(data, "MAIL failed: %d", smtpcode);
result = CURLE_SEND_ERROR;
- state(conn, SMTP_STOP);
}
else
/* Start the RCPT TO command */
if(smtpcode/100 != 2) {
failf(data, "RCPT failed: %d", smtpcode);
result = CURLE_SEND_ERROR;
- state(conn, SMTP_STOP);
}
else {
smtp->rcpt = smtp->rcpt->next;
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