aboutsummaryrefslogtreecommitdiff
path: root/lib/imap.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/imap.c')
-rw-r--r--lib/imap.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/lib/imap.c b/lib/imap.c
index 113907a97..12af79553 100644
--- a/lib/imap.c
+++ b/lib/imap.c
@@ -128,7 +128,8 @@ const struct Curl_handler Curl_handler_imap = {
ZERO_NULL, /* perform_getsock */
imap_disconnect, /* disconnect */
PORT_IMAP, /* defport */
- PROT_IMAP /* protocol */
+ PROT_IMAP, /* protocol */
+ PROTOPT_CLOSEACTION /* flags */
};
@@ -151,7 +152,8 @@ const struct Curl_handler Curl_handler_imaps = {
ZERO_NULL, /* perform_getsock */
imap_disconnect, /* disconnect */
PORT_IMAPS, /* defport */
- PROT_IMAP | PROT_IMAPS | PROT_SSL /* protocol */
+ PROT_IMAP | PROT_IMAPS, /* protocol */
+ PROTOPT_CLOSEACTION | PROTOPT_SSL /* flags */
};
#endif
@@ -174,7 +176,8 @@ static const struct Curl_handler Curl_handler_imap_proxy = {
ZERO_NULL, /* perform_getsock */
ZERO_NULL, /* disconnect */
PORT_IMAP, /* defport */
- PROT_HTTP /* protocol */
+ PROT_HTTP, /* protocol */
+ PROTOPT_NONE /* flags */
};
@@ -197,7 +200,8 @@ static const struct Curl_handler Curl_handler_imaps_proxy = {
ZERO_NULL, /* perform_getsock */
ZERO_NULL, /* disconnect */
PORT_IMAPS, /* defport */
- PROT_HTTP /* protocol */
+ PROT_HTTP, /* protocol */
+ PROTOPT_NONE /* flags */
};
#endif
#endif
@@ -351,7 +355,7 @@ static CURLcode imap_state_starttls_resp(struct connectdata *conn,
else {
result = Curl_ssl_connect(conn, FIRSTSOCKET);
if(CURLE_OK == result) {
- conn->protocol |= PROT_IMAPS;
+ conn->handler = &Curl_handler_imaps;
result = imap_state_login(conn);
}
}
@@ -368,7 +372,7 @@ static CURLcode imap_state_upgrade_tls(struct connectdata *conn)
result = Curl_ssl_connect_nonblocking(conn, FIRSTSOCKET, &imapc->ssldone);
if(imapc->ssldone) {
- conn->protocol |= PROT_IMAPS;
+ conn->handler = &Curl_handler_imaps;
result = imap_state_login(conn);
state(conn, IMAP_STOP);
}
@@ -617,7 +621,7 @@ static CURLcode imap_multi_statemach(struct connectdata *conn,
struct imap_conn *imapc = &conn->proto.imapc;
CURLcode result;
- if((conn->protocol & PROT_IMAPS) && !imapc->ssldone) {
+ if((conn->handler->protocol & PROT_IMAPS) && !imapc->ssldone) {
result = Curl_ssl_connect_nonblocking(conn, FIRSTSOCKET, &imapc->ssldone);
}
else {
@@ -734,7 +738,8 @@ static CURLcode imap_connect(struct connectdata *conn,
}
#endif /* !CURL_DISABLE_HTTP && !CURL_DISABLE_PROXY */
- if((conn->protocol & PROT_IMAPS) && data->state.used_interface != Curl_if_multi) {
+ if((conn->handler->protocol & PROT_IMAPS) &&
+ 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 */