curl: switched back to OpenSSL, updated to latest version
This commit is contained in:
@@ -80,10 +80,10 @@
|
||||
#include "rawstr.h"
|
||||
#include "curl_sasl.h"
|
||||
#include "warnless.h"
|
||||
#include "curl_printf.h"
|
||||
|
||||
/* The last 3 #include files should be in this order */
|
||||
#include "curl_printf.h"
|
||||
#include "curl_memory.h"
|
||||
/* The last #include file should be: */
|
||||
#include "memdebug.h"
|
||||
|
||||
/* Local API functions */
|
||||
@@ -364,7 +364,7 @@ static bool imap_endofresp(struct connectdata *conn, char *line, size_t len,
|
||||
a space and optionally some text as per RFC-3501 for the AUTHENTICATE and
|
||||
APPEND commands and as outlined in Section 4. Examples of RFC-4959 but
|
||||
some e-mail servers ignore this and only send a single + instead. */
|
||||
if(!imap->custom && ((len == 3 && !memcmp("+", line, 1)) ||
|
||||
if(imap && !imap->custom && ((len == 3 && !memcmp("+", line, 1)) ||
|
||||
(len >= 2 && !memcmp("+ ", line, 2)))) {
|
||||
switch(imapc->state) {
|
||||
/* States which are interested in continuation responses */
|
||||
@@ -1020,9 +1020,10 @@ static CURLcode imap_state_login_resp(struct connectdata *conn,
|
||||
return result;
|
||||
}
|
||||
|
||||
/* For LIST responses */
|
||||
static CURLcode imap_state_list_resp(struct connectdata *conn, int imapcode,
|
||||
imapstate instate)
|
||||
/* For LIST and SEARCH responses */
|
||||
static CURLcode imap_state_listsearch_resp(struct connectdata *conn,
|
||||
int imapcode,
|
||||
imapstate instate)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
char *line = conn->data->state.buffer;
|
||||
@@ -1249,31 +1250,6 @@ static CURLcode imap_state_append_final_resp(struct connectdata *conn,
|
||||
return result;
|
||||
}
|
||||
|
||||
/* For SEARCH responses */
|
||||
static CURLcode imap_state_search_resp(struct connectdata *conn, int imapcode,
|
||||
imapstate instate)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
char *line = conn->data->state.buffer;
|
||||
size_t len = strlen(line);
|
||||
|
||||
(void)instate; /* No use for this yet */
|
||||
|
||||
if(imapcode == '*') {
|
||||
/* Temporarily add the LF character back and send as body to the client */
|
||||
line[len] = '\n';
|
||||
result = Curl_client_write(conn, CLIENTWRITE_BODY, line, len + 1);
|
||||
line[len] = '\0';
|
||||
}
|
||||
else if(imapcode != 'O')
|
||||
result = CURLE_QUOTE_ERROR; /* TODO: Fix error code */
|
||||
else
|
||||
/* End of DO phase */
|
||||
state(conn, IMAP_STOP);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static CURLcode imap_statemach_act(struct connectdata *conn)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
@@ -1327,7 +1303,7 @@ static CURLcode imap_statemach_act(struct connectdata *conn)
|
||||
break;
|
||||
|
||||
case IMAP_LIST:
|
||||
result = imap_state_list_resp(conn, imapcode, imapc->state);
|
||||
result = imap_state_listsearch_resp(conn, imapcode, imapc->state);
|
||||
break;
|
||||
|
||||
case IMAP_SELECT:
|
||||
@@ -1351,7 +1327,7 @@ static CURLcode imap_statemach_act(struct connectdata *conn)
|
||||
break;
|
||||
|
||||
case IMAP_SEARCH:
|
||||
result = imap_state_search_resp(conn, imapcode, imapc->state);
|
||||
result = imap_state_listsearch_resp(conn, imapcode, imapc->state);
|
||||
break;
|
||||
|
||||
case IMAP_LOGOUT:
|
||||
@@ -1486,10 +1462,6 @@ static CURLcode imap_done(struct connectdata *conn, CURLcode status,
|
||||
(void)premature;
|
||||
|
||||
if(!imap)
|
||||
/* When the easy handle is removed from the multi interface while libcurl
|
||||
is still trying to resolve the host name, the IMAP struct is not yet
|
||||
initialized. However, the removal action calls Curl_done() which in
|
||||
turn calls this function, so we simply return success. */
|
||||
return CURLE_OK;
|
||||
|
||||
if(status) {
|
||||
@@ -1512,8 +1484,7 @@ static CURLcode imap_done(struct connectdata *conn, CURLcode status,
|
||||
|
||||
TODO: when the multi interface is used, this _really_ should be using
|
||||
the imap_multi_statemach function but we have no general support for
|
||||
non-blocking DONE operations, not in the multi state machine and with
|
||||
Curl_done() invokes on several places in the code!
|
||||
non-blocking DONE operations!
|
||||
*/
|
||||
if(!result)
|
||||
result = imap_block_statemach(conn);
|
||||
@@ -1825,6 +1796,7 @@ static CURLcode imap_sendf(struct connectdata *conn, const char *fmt, ...)
|
||||
*/
|
||||
static char *imap_atom(const char *str, bool escape_only)
|
||||
{
|
||||
/* !checksrc! disable PARENBRACE 1 */
|
||||
const char atom_specials[] = "(){ %*]";
|
||||
const char *p1;
|
||||
char *p2;
|
||||
|
||||
Reference in New Issue
Block a user