From: Steve Holme Date: Sat, 2 Mar 2013 20:40:38 +0000 (+0000) Subject: imap: Simplified the imap_state_append_resp() function X-Git-Tag: curl-7_30_0~214 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e94fbcabd77d51dd3a01e0d3dec3646abaa5742e;p=thirdparty%2Fcurl.git imap: Simplified the imap_state_append_resp() function Introduced the result code variable to simplify the state changes and remove the hard returns. --- diff --git a/lib/imap.c b/lib/imap.c index 2632961429..c61231b2a4 100644 --- a/lib/imap.c +++ b/lib/imap.c @@ -1391,23 +1391,23 @@ static CURLcode imap_state_append_resp(struct connectdata *conn, int imapcode, imapstate instate) { + CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; (void)instate; /* No use for this yet */ if(imapcode != '+') { - state(conn, IMAP_STOP); - return CURLE_UPLOAD_FAILED; + result = CURLE_UPLOAD_FAILED; } else { Curl_pgrsSetUploadSize(data, data->set.infilesize); Curl_setup_transfer(conn, -1, -1, FALSE, NULL, /* No download */ FIRSTSOCKET, NULL); - - /* Stop now and let the core go from DO to PERFORM phase */ - state(conn, IMAP_STOP); - return CURLE_OK; } + + state(conn, IMAP_STOP); + + return result; } /* For final APPEND responses performed after the upload */