imap: Tidied up the APPEND and final APPEND response functions
Removed unnecessary state changes on failure and setting of result codes on success.
This commit is contained in:
18
lib/imap.c
18
lib/imap.c
@@ -1506,14 +1506,15 @@ static CURLcode imap_state_append_resp(struct connectdata *conn, int imapcode,
|
|||||||
result = CURLE_UPLOAD_FAILED;
|
result = CURLE_UPLOAD_FAILED;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
/* Set the progress upload size */
|
||||||
Curl_pgrsSetUploadSize(data, data->set.infilesize);
|
Curl_pgrsSetUploadSize(data, data->set.infilesize);
|
||||||
|
|
||||||
/* IMAP upload */
|
/* IMAP upload */
|
||||||
Curl_setup_transfer(conn, -1, -1, FALSE, NULL, FIRSTSOCKET, NULL);
|
Curl_setup_transfer(conn, -1, -1, FALSE, NULL, FIRSTSOCKET, NULL);
|
||||||
}
|
|
||||||
|
|
||||||
/* End of DO phase */
|
/* End of DO phase */
|
||||||
state(conn, IMAP_STOP);
|
state(conn, IMAP_STOP);
|
||||||
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -1527,14 +1528,11 @@ static CURLcode imap_state_append_final_resp(struct connectdata *conn,
|
|||||||
|
|
||||||
(void)instate; /* No use for this yet */
|
(void)instate; /* No use for this yet */
|
||||||
|
|
||||||
/* Final response, stop and return the final status */
|
if(imapcode != 'O')
|
||||||
if(imapcode == 'O')
|
|
||||||
result = CURLE_OK;
|
|
||||||
else
|
|
||||||
result = CURLE_UPLOAD_FAILED;
|
result = CURLE_UPLOAD_FAILED;
|
||||||
|
else
|
||||||
/* End of DONE phase */
|
/* End of DONE phase */
|
||||||
state(conn, IMAP_STOP);
|
state(conn, IMAP_STOP);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user