From c43127414d89ccb9ef6517081f68986d991bcfb3 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 17 Jan 2013 12:59:23 +0100 Subject: always-multi: always use non-blocking internals Remove internal separated behavior of the easy vs multi intercace. curl_easy_perform() is now using the multi interface itself. Several minor multi interface quirks and bugs have been fixed in the process. Much help with debugging this has been provided by: Yang Tse --- lib/pop3.c | 30 +++++------------------------- 1 file changed, 5 insertions(+), 25 deletions(-) (limited to 'lib/pop3.c') diff --git a/lib/pop3.c b/lib/pop3.c index e8fd9c52c..b5ea7c23f 100644 --- a/lib/pop3.c +++ b/lib/pop3.c @@ -570,17 +570,8 @@ static CURLcode pop3_state_starttls_resp(struct connectdata *conn, result = pop3_state_capa(conn); } else { - if(data->state.used_interface == Curl_if_multi) { - state(conn, POP3_UPGRADETLS); - result = pop3_state_upgrade_tls(conn); - } - else { - result = Curl_ssl_connect(conn, FIRSTSOCKET); - if(CURLE_OK == result) { - pop3_to_pop3s(conn); - result = pop3_state_capa(conn); - } - } + state(conn, POP3_UPGRADETLS); + result = pop3_state_upgrade_tls(conn); } return result; @@ -1301,7 +1292,6 @@ static CURLcode pop3_connect(struct connectdata *conn, bool *done) { CURLcode result; struct pop3_conn *pop3c = &conn->proto.pop3c; - struct SessionHandle *data = conn->data; struct pingpong *pp = &pop3c->pp; *done = FALSE; /* default to not done yet */ @@ -1336,13 +1326,7 @@ static CURLcode pop3_connect(struct connectdata *conn, bool *done) /* Start off waiting for the server greeting response */ state(conn, POP3_SERVERGREET); - if(data->state.used_interface == Curl_if_multi) - result = pop3_multi_statemach(conn, done); - else { - result = pop3_easy_statemach(conn); - if(!result) - *done = TRUE; - } + result = pop3_multi_statemach(conn, done); return result; } @@ -1418,12 +1402,8 @@ static CURLcode pop3_perform(struct connectdata *conn, bool *connected, return result; /* Run the state-machine */ - if(conn->data->state.used_interface == Curl_if_multi) - result = pop3_multi_statemach(conn, dophase_done); - else { - result = pop3_easy_statemach(conn); - *dophase_done = TRUE; /* with the easy interface we are done here */ - } + result = pop3_multi_statemach(conn, dophase_done); + *connected = conn->bits.tcpconnect[FIRSTSOCKET]; if(*dophase_done) -- cgit v1.2.3