From 4838d196fdbfcc3e8779ff4416ec5d0d35561172 Mon Sep 17 00:00:00 2001 From: Steve Holme Date: Sat, 9 Mar 2013 11:55:48 +0000 Subject: email: Simplified the logout / quit functions Moved the blocking state machine to the disconnect functions so that the logout / quit functions are only responsible for sending the actual command needed to logout or quit. Additionally removed the hard return on failure. --- lib/imap.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'lib/imap.c') diff --git a/lib/imap.c b/lib/imap.c index 6ce6b12ec..73ace8576 100644 --- a/lib/imap.c +++ b/lib/imap.c @@ -1950,13 +1950,10 @@ static CURLcode imap_logout(struct connectdata *conn) CURLcode result = CURLE_OK; /* Send the LOGOUT command */ - result = imap_sendf(conn, "LOGOUT", NULL); - if(result) - return result; + result = imap_sendf(conn, "LOGOUT"); - state(conn, IMAP_LOGOUT); - - result = imap_block_statemach(conn); + if(!result) + state(conn, IMAP_LOGOUT); return result; } @@ -1979,7 +1976,8 @@ static CURLcode imap_disconnect(struct connectdata *conn, bool dead_connection) /* The IMAP session may or may not have been allocated/setup at this point! */ if(!dead_connection && imapc->pp.conn) - (void)imap_logout(conn); /* ignore errors on LOGOUT */ + if(!imap_logout(conn)) + (void)imap_block_statemach(conn); /* ignore errors on LOGOUT */ /* Disconnect from the server */ Curl_pp_disconnect(&imapc->pp); -- cgit v1.2.3