aboutsummaryrefslogtreecommitdiff
path: root/lib/pop3.c
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2013-03-09 11:55:48 +0000
committerSteve Holme <steve_holme@hotmail.com>2013-03-09 11:55:48 +0000
commit4838d196fdbfcc3e8779ff4416ec5d0d35561172 (patch)
tree72ba42ba584036fb494c396a686143579c13a9c1 /lib/pop3.c
parentf691f9609c314c794cf51b9b906ca8fc4f553a73 (diff)
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.
Diffstat (limited to 'lib/pop3.c')
-rw-r--r--lib/pop3.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/pop3.c b/lib/pop3.c
index 4c008cafb..88c8f2bc7 100644
--- a/lib/pop3.c
+++ b/lib/pop3.c
@@ -1470,13 +1470,10 @@ static CURLcode pop3_quit(struct connectdata *conn)
CURLcode result = CURLE_OK;
/* Send the QUIT command */
- result = Curl_pp_sendf(&conn->proto.pop3c.pp, "QUIT", NULL);
- if(result)
- return result;
+ result = Curl_pp_sendf(&conn->proto.pop3c.pp, "QUIT");
- state(conn, POP3_QUIT);
-
- result = pop3_block_statemach(conn);
+ if(!result)
+ state(conn, POP3_QUIT);
return result;
}
@@ -1500,7 +1497,8 @@ static CURLcode pop3_disconnect(struct connectdata *conn,
/* The POP3 session may or may not have been allocated/setup at this
point! */
if(!dead_connection && pop3c->pp.conn)
- (void)pop3_quit(conn); /* ignore errors on QUIT */
+ if(!pop3_quit(conn))
+ (void)pop3_block_statemach(conn); /* ignore errors on QUIT */
/* Disconnect from the server */
Curl_pp_disconnect(&pop3c->pp);