mirror of
https://github.com/moparisthebest/curl
synced 2024-12-22 16:18:48 -05:00
imap: 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:
parent
b4eb08e7fb
commit
b06a786226
24
lib/imap.c
24
lib/imap.c
@ -492,10 +492,8 @@ static CURLcode imap_state_capability(struct connectdata *conn)
|
|||||||
/* Send the CAPABILITY command */
|
/* Send the CAPABILITY command */
|
||||||
result = imap_sendf(conn, "CAPABILITY");
|
result = imap_sendf(conn, "CAPABILITY");
|
||||||
|
|
||||||
if(result)
|
if(!result)
|
||||||
return result;
|
state(conn, IMAP_CAPABILITY);
|
||||||
|
|
||||||
state(conn, IMAP_CAPABILITY);
|
|
||||||
|
|
||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
}
|
}
|
||||||
@ -559,10 +557,8 @@ static CURLcode imap_state_login(struct connectdata *conn)
|
|||||||
Curl_safefree(user);
|
Curl_safefree(user);
|
||||||
Curl_safefree(passwd);
|
Curl_safefree(passwd);
|
||||||
|
|
||||||
if(result)
|
if(!result)
|
||||||
return result;
|
state(conn, IMAP_LOGIN);
|
||||||
|
|
||||||
state(conn, IMAP_LOGIN);
|
|
||||||
|
|
||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
}
|
}
|
||||||
@ -686,10 +682,8 @@ static CURLcode imap_select(struct connectdata *conn)
|
|||||||
result = imap_sendf(conn, "SELECT %s", mailbox);
|
result = imap_sendf(conn, "SELECT %s", mailbox);
|
||||||
|
|
||||||
Curl_safefree(mailbox);
|
Curl_safefree(mailbox);
|
||||||
if(result)
|
if(!result)
|
||||||
return result;
|
state(conn, IMAP_SELECT);
|
||||||
|
|
||||||
state(conn, IMAP_SELECT);
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -703,10 +697,8 @@ static CURLcode imap_fetch(struct connectdata *conn)
|
|||||||
result = imap_sendf(conn, "FETCH %s BODY[%s]",
|
result = imap_sendf(conn, "FETCH %s BODY[%s]",
|
||||||
imap->uid ? imap->uid : "1",
|
imap->uid ? imap->uid : "1",
|
||||||
imap->section ? imap->section : "");
|
imap->section ? imap->section : "");
|
||||||
if(result)
|
if(!result)
|
||||||
return result;
|
state(conn, IMAP_FETCH);
|
||||||
|
|
||||||
state(conn, IMAP_FETCH);
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user