From: Steve Holme Date: Thu, 7 Mar 2013 18:21:58 +0000 (+0000) Subject: email: Optimised block_statemach() functions X-Git-Tag: curl-7_30_0~174 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=67b6fa5f95e4e938ad0b0209d42c148ef29c04d2;p=thirdparty%2Fcurl.git email: Optimised block_statemach() functions Optimised the result test in each of the block_statemach() functions. --- diff --git a/lib/imap.c b/lib/imap.c index 186ff63f6b..66dede9db0 100644 --- a/lib/imap.c +++ b/lib/imap.c @@ -1685,10 +1685,8 @@ static CURLcode imap_block_statemach(struct connectdata *conn) CURLcode result = CURLE_OK; struct imap_conn *imapc = &conn->proto.imapc; - while(imapc->state != IMAP_STOP) { + while(imapc->state != IMAP_STOP && !result) { result = Curl_pp_statemach(&imapc->pp, TRUE); - if(result) - break; } return result; diff --git a/lib/pop3.c b/lib/pop3.c index d809b488af..1924ece467 100644 --- a/lib/pop3.c +++ b/lib/pop3.c @@ -1262,10 +1262,8 @@ static CURLcode pop3_block_statemach(struct connectdata *conn) CURLcode result = CURLE_OK; struct pop3_conn *pop3c = &conn->proto.pop3c; - while(pop3c->state != POP3_STOP) { + while(pop3c->state != POP3_STOP && !result) { result = Curl_pp_statemach(&pop3c->pp, TRUE); - if(result) - break; } return result; diff --git a/lib/smtp.c b/lib/smtp.c index c4558646fd..15e00a98cb 100644 --- a/lib/smtp.c +++ b/lib/smtp.c @@ -1254,10 +1254,8 @@ static CURLcode smtp_block_statemach(struct connectdata *conn) CURLcode result = CURLE_OK; struct smtp_conn *smtpc = &conn->proto.smtpc; - while(smtpc->state != SMTP_STOP) { + while(smtpc->state != SMTP_STOP && !result) { result = Curl_pp_statemach(&smtpc->pp, TRUE); - if(result) - break; } return result;