return CURLE_OK;
}
+#ifdef USE_SSL
+static void imap_to_imaps(struct connectdata *conn)
+{
+ conn->handler = &Curl_handler_imaps;
+}
+#else
+#define imap_to_imaps(x)
+#endif
+
/* for STARTTLS responses */
static CURLcode imap_state_starttls_resp(struct connectdata *conn,
int imapcode,
else {
result = Curl_ssl_connect(conn, FIRSTSOCKET);
if(CURLE_OK == result) {
- conn->handler = &Curl_handler_imaps;
+ imap_to_imaps(conn);
result = imap_state_login(conn);
}
}
result = Curl_ssl_connect_nonblocking(conn, FIRSTSOCKET, &imapc->ssldone);
if(imapc->ssldone) {
- conn->handler = &Curl_handler_imaps;
+ imap_to_imaps(conn);
result = imap_state_login(conn);
state(conn, IMAP_STOP);
}
return Curl_pp_getsock(&conn->proto.pop3c.pp, socks, numsocks);
}
+#ifdef USE_SSL
+static void pop3_to_pop3s(struct connectdata *conn)
+{
+ conn->handler = &Curl_handler_pop3s;
+}
+#else
+#define pop3_to_pop3s(x)
+#endif
+
/* for STARTTLS responses */
static CURLcode pop3_state_starttls_resp(struct connectdata *conn,
int pop3code,
/* Curl_ssl_connect is BLOCKING */
result = Curl_ssl_connect(conn, FIRSTSOCKET);
if(CURLE_OK == result) {
- conn->handler = &Curl_handler_pop3s;
+ pop3_to_pop3s(conn);
result = pop3_state_user(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,
/* 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);
}
}