pop3: Updated the coding style for state changes after a send operation

Some state changes would be performed after a failure test that
performed a hard return, whilst others would be performed within a test
for success. Updated the code, for consistency, so all instances are
performed within a success test.
This commit is contained in:
Steve Holme 2013-03-03 13:36:12 +00:00
parent b1ebf4bda1
commit 757aa7b09d

View File

@ -389,12 +389,10 @@ static CURLcode pop3_state_capa(struct connectdata *conn)
/* Send the CAPA command */ /* Send the CAPA command */
result = Curl_pp_sendf(&pop3c->pp, "CAPA"); result = Curl_pp_sendf(&pop3c->pp, "CAPA");
if(result) if(!result)
return result; state(conn, POP3_CAPA);
state(conn, POP3_CAPA); return result;
return CURLE_OK;
} }
static CURLcode pop3_state_starttls(struct connectdata *conn) static CURLcode pop3_state_starttls(struct connectdata *conn)
@ -446,12 +444,10 @@ static CURLcode pop3_state_user(struct connectdata *conn)
/* Send the USER command */ /* Send the USER command */
result = Curl_pp_sendf(&conn->proto.pop3c.pp, "USER %s", result = Curl_pp_sendf(&conn->proto.pop3c.pp, "USER %s",
conn->user ? conn->user : ""); conn->user ? conn->user : "");
if(result) if(!result)
return result; state(conn, POP3_USER);
state(conn, POP3_USER); return result;
return CURLE_OK;
} }
#ifndef CURL_DISABLE_CRYPTO_AUTH #ifndef CURL_DISABLE_CRYPTO_AUTH
@ -1021,10 +1017,8 @@ static CURLcode pop3_state_user_resp(struct connectdata *conn, int pop3code,
/* Send the PASS command */ /* Send the PASS command */
result = Curl_pp_sendf(&conn->proto.pop3c.pp, "PASS %s", result = Curl_pp_sendf(&conn->proto.pop3c.pp, "PASS %s",
conn->passwd ? conn->passwd : ""); conn->passwd ? conn->passwd : "");
if(result) if(!result)
return result; state(conn, POP3_PASS);
state(conn, POP3_PASS);
return result; return result;
} }
@ -1078,10 +1072,8 @@ static CURLcode pop3_command(struct connectdata *conn)
(pop3->custom && pop3->custom[0] != '\0' ? (pop3->custom && pop3->custom[0] != '\0' ?
pop3->custom : command)); pop3->custom : command));
if(result) if(!result)
return result; state(conn, POP3_COMMAND);
state(conn, POP3_COMMAND);
return result; return result;
} }