protocol handler cleanup: SSL awareness

As a follow-up to commit 8831000bc0: don't assume that the SSL powered
protocol alternatives are available.
This commit is contained in:
Daniel Stenberg
2011-03-15 10:02:05 +01:00
parent 211504ba8a
commit cc228ea6f6
3 changed files with 31 additions and 4 deletions

View File

@@ -454,6 +454,15 @@ static int smtp_getsock(struct connectdata *conn,
return Curl_pp_getsock(&conn->proto.smtpc.pp, socks, numsocks);
}
#ifdef USE_SSL
static void smtp_to_smtps(struct connectdata *conn)
{
conn->handler = &Curl_handler_smtps;
}
#else
#define smtp_to_smtps(x)
#endif
/* for STARTTLS responses */
static CURLcode smtp_state_starttls_resp(struct connectdata *conn,
int smtpcode,
@@ -475,7 +484,7 @@ static CURLcode smtp_state_starttls_resp(struct connectdata *conn,
/* Curl_ssl_connect is BLOCKING */
result = Curl_ssl_connect(conn, FIRSTSOCKET);
if(CURLE_OK == result) {
conn->handler = &Curl_handler_smtps;
smtp_to_smtps(conn);
result = smtp_state_ehlo(conn);
}
}