]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
email: Optimised block_statemach() functions
authorSteve Holme <steve_holme@hotmail.com>
Thu, 7 Mar 2013 18:21:58 +0000 (18:21 +0000)
committerSteve Holme <steve_holme@hotmail.com>
Thu, 7 Mar 2013 18:21:58 +0000 (18:21 +0000)
Optimised the result test in each of the block_statemach() functions.

lib/imap.c
lib/pop3.c
lib/smtp.c

index 186ff63f6b0c9d59acfc36140354e14fc3dc20a5..66dede9db0d3dee9766446dcb80a36ff532e4201 100644 (file)
@@ -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;
index d809b488af3468c378ed05a60c5fffdbdbcad89b..1924ece46718f12a8fc50ef2de2b1a87fc7e7837 100644 (file)
@@ -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;
index c4558646fd877dd2853479745c5dc85c47e153c9..15e00a98cb293935d9433875a9724d4a9f7d9bbd 100644 (file)
@@ -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;