From e34131db783336aa17fa0aa664635867459b2a85 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 5 May 2011 15:49:43 +0200 Subject: SSL: check for SSL, not specific protocols Code cleanup to check less for protocols and more for the specific relevant feature. Like if SSL is required. --- lib/imap.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'lib/imap.c') diff --git a/lib/imap.c b/lib/imap.c index 06135a309..a01da3eec 100644 --- a/lib/imap.c +++ b/lib/imap.c @@ -629,12 +629,10 @@ static CURLcode imap_multi_statemach(struct connectdata *conn, struct imap_conn *imapc = &conn->proto.imapc; CURLcode result; - if((conn->handler->protocol & CURLPROTO_IMAPS) && !imapc->ssldone) { + if((conn->handler->flags & PROTOPT_SSL) && !imapc->ssldone) result = Curl_ssl_connect_nonblocking(conn, FIRSTSOCKET, &imapc->ssldone); - } - else { + else result = Curl_pp_multi_statemach(&imapc->pp); - } *done = (bool)(imapc->state == IMAP_STOP); @@ -744,11 +742,9 @@ static CURLcode imap_connect(struct connectdata *conn, return result; } - if((conn->handler->protocol & CURLPROTO_IMAPS) && + if((conn->handler->flags & PROTOPT_SSL) && data->state.used_interface != Curl_if_multi) { /* BLOCKING */ - /* IMAPS is simply imap with SSL for the control channel */ - /* now, perform the SSL initialization for this socket */ result = Curl_ssl_connect(conn, FIRSTSOCKET); if(result) return result; -- cgit v1.2.3