1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-11 12:05:06 -05:00

smtp: Moved smtp_rcpt_to() to be with the other perform functions

This commit is contained in:
Steve Holme 2013-04-16 19:32:55 +01:00
parent 8093f9541e
commit e621a5f6ea

View File

@ -569,6 +569,27 @@ static CURLcode smtp_mail(struct connectdata *conn)
return result;
}
static CURLcode smtp_rcpt_to(struct connectdata *conn)
{
CURLcode result = CURLE_OK;
struct SessionHandle *data = conn->data;
struct SMTP *smtp = data->state.proto.smtp;
/* Send the RCPT TO command */
if(smtp->rcpt) {
if(smtp->rcpt->data[0] == '<')
result = Curl_pp_sendf(&conn->proto.smtpc.pp, "RCPT TO:%s",
smtp->rcpt->data);
else
result = Curl_pp_sendf(&conn->proto.smtpc.pp, "RCPT TO:<%s>",
smtp->rcpt->data);
if(!result)
state(conn, SMTP_RCPT);
}
return result;
}
/* For the initial server greeting */
static CURLcode smtp_state_servergreet_resp(struct connectdata *conn,
int smtpcode,
@ -1006,27 +1027,6 @@ static CURLcode smtp_state_auth_final_resp(struct connectdata *conn,
return result;
}
static CURLcode smtp_rcpt_to(struct connectdata *conn)
{
CURLcode result = CURLE_OK;
struct SessionHandle *data = conn->data;
struct SMTP *smtp = data->state.proto.smtp;
/* Send the RCPT TO command */
if(smtp->rcpt) {
if(smtp->rcpt->data[0] == '<')
result = Curl_pp_sendf(&conn->proto.smtpc.pp, "RCPT TO:%s",
smtp->rcpt->data);
else
result = Curl_pp_sendf(&conn->proto.smtpc.pp, "RCPT TO:<%s>",
smtp->rcpt->data);
if(!result)
state(conn, SMTP_RCPT);
}
return result;
}
/* For MAIL responses */
static CURLcode smtp_state_mail_resp(struct connectdata *conn, int smtpcode,
smtpstate instate)