aboutsummaryrefslogtreecommitdiff
path: root/lib/smtp.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/smtp.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/smtp.c')
-rw-r--r--lib/smtp.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/smtp.c b/lib/smtp.c
index c9669dafc..8367b8925 100644
--- a/lib/smtp.c
+++ b/lib/smtp.c
@@ -1501,12 +1501,9 @@ static CURLcode smtp_quit(struct connectdata *conn)
/* Send the QUIT command */
result = Curl_pp_sendf(&conn->proto.smtpc.pp, "QUIT");
- if(result)
- return result;
- state(conn, SMTP_QUIT);
-
- result = smtp_block_statemach(conn);
+ if(!result)
+ state(conn, SMTP_QUIT);
return result;
}
@@ -1530,7 +1527,8 @@ static CURLcode smtp_disconnect(struct connectdata *conn,
/* The SMTP session may or may not have been allocated/setup at this
point! */
if(!dead_connection && smtpc->pp.conn)
- (void)smtp_quit(conn); /* ignore errors on QUIT */
+ if(!smtp_quit(conn))
+ (void)smtp_block_statemach(conn); /* ignore errors on QUIT */
/* Disconnect from the server */
Curl_pp_disconnect(&smtpc->pp);