mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 23:58:49 -05:00
imap: Tidied up the LIST response function
Reworked comments as they referenced custom commands, removed unnecessary state change on failure and setting of result code on success.
This commit is contained in:
parent
24ffceed81
commit
c9f9f601b8
15
lib/imap.c
15
lib/imap.c
@ -1323,23 +1323,16 @@ static CURLcode imap_state_list_resp(struct connectdata *conn, int imapcode,
|
|||||||
(void)instate; /* No use for this yet */
|
(void)instate; /* No use for this yet */
|
||||||
|
|
||||||
if(imapcode == '*') {
|
if(imapcode == '*') {
|
||||||
/* The client which asked for this custom command should know best
|
/* Temporarily add the LF character back and send as body to the client */
|
||||||
how to cope with the result, just send it as body.
|
|
||||||
Add back the LF character temporarily while saving. */
|
|
||||||
line[len] = '\n';
|
line[len] = '\n';
|
||||||
result = Curl_client_write(conn, CLIENTWRITE_BODY, line, len + 1);
|
result = Curl_client_write(conn, CLIENTWRITE_BODY, line, len + 1);
|
||||||
line[len] = '\0';
|
line[len] = '\0';
|
||||||
}
|
}
|
||||||
else {
|
else if(imapcode != 'O')
|
||||||
/* Final response. Stop and return the final status. */
|
result = CURLE_QUOTE_ERROR; /* TODO: Fix error code */
|
||||||
if(imapcode != 'O')
|
else
|
||||||
result = CURLE_QUOTE_ERROR; /* TODO: Fix error code */
|
|
||||||
else
|
|
||||||
result = CURLE_OK;
|
|
||||||
|
|
||||||
/* End of DO phase */
|
/* End of DO phase */
|
||||||
state(conn, IMAP_STOP);
|
state(conn, IMAP_STOP);
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user