aboutsummaryrefslogtreecommitdiff
path: root/lib/smtp.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2011-03-15 10:02:05 +0100
committerDaniel Stenberg <daniel@haxx.se>2011-03-15 10:02:05 +0100
commitcc228ea6f61a4543cbec3568b37bf881ab1010ac (patch)
treef65d5ef31d767ceb451dc2901ef6ad7d34b8ed1e /lib/smtp.c
parent211504ba8a31d0696f728eed167b083f0c0f474d (diff)
protocol handler cleanup: SSL awareness
As a follow-up to commit 8831000bc0: don't assume that the SSL powered protocol alternatives are available.
Diffstat (limited to 'lib/smtp.c')
-rw-r--r--lib/smtp.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/smtp.c b/lib/smtp.c
index ff0d288c7..71a9c6e8a 100644
--- a/lib/smtp.c
+++ b/lib/smtp.c
@@ -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);
}
}