aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/curl/lib/imap.c
diff options
context:
space:
mode:
authorthegeorg <thegeorg@yandex-team.ru>2022-02-10 16:45:12 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:12 +0300
commit49116032d905455a7b1c994e4a696afc885c1e71 (patch)
treebe835aa92c6248212e705f25388ebafcf84bc7a1 /contrib/libs/curl/lib/imap.c
parent4e839db24a3bbc9f1c610c43d6faaaa99824dcca (diff)
downloadydb-49116032d905455a7b1c994e4a696afc885c1e71.tar.gz
Restoring authorship annotation for <thegeorg@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/libs/curl/lib/imap.c')
-rw-r--r--contrib/libs/curl/lib/imap.c92
1 files changed, 46 insertions, 46 deletions
diff --git a/contrib/libs/curl/lib/imap.c b/contrib/libs/curl/lib/imap.c
index 815da5f5de..c6dd7a2323 100644
--- a/contrib/libs/curl/lib/imap.c
+++ b/contrib/libs/curl/lib/imap.c
@@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
- * are also available at https://curl.se/docs/copyright.html.
+ * are also available at https://curl.se/docs/copyright.html.
*
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
@@ -132,7 +132,7 @@ const struct Curl_handler Curl_handler_imap = {
ZERO_NULL, /* connection_check */
PORT_IMAP, /* defport */
CURLPROTO_IMAP, /* protocol */
- CURLPROTO_IMAP, /* family */
+ CURLPROTO_IMAP, /* family */
PROTOPT_CLOSEACTION| /* flags */
PROTOPT_URLOPTIONS
};
@@ -160,7 +160,7 @@ const struct Curl_handler Curl_handler_imaps = {
ZERO_NULL, /* connection_check */
PORT_IMAPS, /* defport */
CURLPROTO_IMAPS, /* protocol */
- CURLPROTO_IMAP, /* family */
+ CURLPROTO_IMAP, /* family */
PROTOPT_CLOSEACTION | PROTOPT_SSL | /* flags */
PROTOPT_URLOPTIONS
};
@@ -189,7 +189,7 @@ static void imap_to_imaps(struct connectdata *conn)
conn->handler = &Curl_handler_imaps;
/* Set the connection's upgraded to TLS flag */
- conn->bits.tls_upgraded = TRUE;
+ conn->bits.tls_upgraded = TRUE;
}
#else
#define imap_to_imaps(x) Curl_nop_stmt
@@ -246,7 +246,7 @@ static bool imap_matchresp(const char *line, size_t len, const char *cmd)
static bool imap_endofresp(struct connectdata *conn, char *line, size_t len,
int *resp)
{
- struct IMAP *imap = conn->data->req.p.imap;
+ struct IMAP *imap = conn->data->req.p.imap;
struct imap_conn *imapc = &conn->proto.imapc;
const char *id = imapc->resptag;
size_t id_len = strlen(id);
@@ -607,7 +607,7 @@ static CURLcode imap_perform_list(struct connectdata *conn)
{
CURLcode result = CURLE_OK;
struct Curl_easy *data = conn->data;
- struct IMAP *imap = data->req.p.imap;
+ struct IMAP *imap = data->req.p.imap;
if(imap->custom)
/* Send the custom request */
@@ -642,7 +642,7 @@ static CURLcode imap_perform_select(struct connectdata *conn)
{
CURLcode result = CURLE_OK;
struct Curl_easy *data = conn->data;
- struct IMAP *imap = data->req.p.imap;
+ struct IMAP *imap = data->req.p.imap;
struct imap_conn *imapc = &conn->proto.imapc;
char *mailbox;
@@ -681,7 +681,7 @@ static CURLcode imap_perform_select(struct connectdata *conn)
static CURLcode imap_perform_fetch(struct connectdata *conn)
{
CURLcode result = CURLE_OK;
- struct IMAP *imap = conn->data->req.p.imap;
+ struct IMAP *imap = conn->data->req.p.imap;
/* Check we have a UID */
if(imap->uid) {
@@ -729,7 +729,7 @@ static CURLcode imap_perform_append(struct connectdata *conn)
{
CURLcode result = CURLE_OK;
struct Curl_easy *data = conn->data;
- struct IMAP *imap = data->req.p.imap;
+ struct IMAP *imap = data->req.p.imap;
char *mailbox;
/* Check we have a mailbox */
@@ -799,7 +799,7 @@ static CURLcode imap_perform_append(struct connectdata *conn)
static CURLcode imap_perform_search(struct connectdata *conn)
{
CURLcode result = CURLE_OK;
- struct IMAP *imap = conn->data->req.p.imap;
+ struct IMAP *imap = conn->data->req.p.imap;
/* Check we have a query string */
if(!imap->query) {
@@ -1053,7 +1053,7 @@ static CURLcode imap_state_select_resp(struct connectdata *conn, int imapcode,
{
CURLcode result = CURLE_OK;
struct Curl_easy *data = conn->data;
- struct IMAP *imap = conn->data->req.p.imap;
+ struct IMAP *imap = conn->data->req.p.imap;
struct imap_conn *imapc = &conn->proto.imapc;
const char *line = data->state.buffer;
@@ -1178,9 +1178,9 @@ static CURLcode imap_state_fetch_resp(struct connectdata *conn, int imapcode,
else {
/* IMAP download */
data->req.maxdownload = size;
- /* force a recv/send check of this connection, as the data might've been
- read off the socket already */
- data->conn->cselect_bits = CURL_CSELECT_IN;
+ /* force a recv/send check of this connection, as the data might've been
+ read off the socket already */
+ data->conn->cselect_bits = CURL_CSELECT_IN;
Curl_setup_transfer(data, FIRSTSOCKET, size, FALSE, -1);
}
}
@@ -1311,7 +1311,7 @@ static CURLcode imap_statemach_act(struct connectdata *conn)
break;
case IMAP_LIST:
- case IMAP_SEARCH:
+ case IMAP_SEARCH:
result = imap_state_listsearch_resp(conn, imapcode, imapc->state);
break;
@@ -1385,7 +1385,7 @@ static CURLcode imap_init(struct connectdata *conn)
struct Curl_easy *data = conn->data;
struct IMAP *imap;
- imap = data->req.p.imap = calloc(sizeof(struct IMAP), 1);
+ imap = data->req.p.imap = calloc(sizeof(struct IMAP), 1);
if(!imap)
result = CURLE_OUT_OF_MEMORY;
@@ -1429,9 +1429,9 @@ static CURLcode imap_connect(struct connectdata *conn, bool *done)
imapc->preftype = IMAP_TYPE_ANY;
Curl_sasl_init(&imapc->sasl, &saslimap);
- Curl_dyn_init(&imapc->dyn, DYN_IMAP_CMD);
+ Curl_dyn_init(&imapc->dyn, DYN_IMAP_CMD);
/* Initialise the pingpong layer */
- Curl_pp_setup(pp);
+ Curl_pp_setup(pp);
Curl_pp_init(pp);
/* Parse the URL options */
@@ -1464,7 +1464,7 @@ static CURLcode imap_done(struct connectdata *conn, CURLcode status,
{
CURLcode result = CURLE_OK;
struct Curl_easy *data = conn->data;
- struct IMAP *imap = data->req.p.imap;
+ struct IMAP *imap = data->req.p.imap;
(void)premature;
@@ -1524,7 +1524,7 @@ static CURLcode imap_perform(struct connectdata *conn, bool *connected,
/* This is IMAP and no proxy */
CURLcode result = CURLE_OK;
struct Curl_easy *data = conn->data;
- struct IMAP *imap = data->req.p.imap;
+ struct IMAP *imap = data->req.p.imap;
struct imap_conn *imapc = &conn->proto.imapc;
bool selected = FALSE;
@@ -1633,7 +1633,7 @@ static CURLcode imap_disconnect(struct connectdata *conn, bool dead_connection)
/* Disconnect from the server */
Curl_pp_disconnect(&imapc->pp);
- Curl_dyn_free(&imapc->dyn);
+ Curl_dyn_free(&imapc->dyn);
/* Cleanup the SASL module */
Curl_sasl_cleanup(conn, imapc->sasl.authused);
@@ -1648,7 +1648,7 @@ static CURLcode imap_disconnect(struct connectdata *conn, bool dead_connection)
/* Call this when the DO phase has completed */
static CURLcode imap_dophase_done(struct connectdata *conn, bool connected)
{
- struct IMAP *imap = conn->data->req.p.imap;
+ struct IMAP *imap = conn->data->req.p.imap;
(void)connected;
@@ -1718,7 +1718,7 @@ static CURLcode imap_setup_connection(struct connectdata *conn)
return result;
/* Clear the TLS upgraded flag */
- conn->bits.tls_upgraded = FALSE;
+ conn->bits.tls_upgraded = FALSE;
return CURLE_OK;
}
@@ -1740,20 +1740,20 @@ static CURLcode imap_sendf(struct connectdata *conn, const char *fmt, ...)
/* Calculate the tag based on the connection ID and command ID */
msnprintf(imapc->resptag, sizeof(imapc->resptag), "%c%03d",
- 'A' + curlx_sltosi(conn->connection_id % 26),
- (++imapc->cmdid)%1000);
-
- /* start with a blank buffer */
- Curl_dyn_reset(&imapc->dyn);
-
- /* append tag + space + fmt */
- result = Curl_dyn_addf(&imapc->dyn, "%s %s", imapc->resptag, fmt);
- if(!result) {
- va_list ap;
- va_start(ap, fmt);
- result = Curl_pp_vsendf(&imapc->pp, Curl_dyn_ptr(&imapc->dyn), ap);
- va_end(ap);
- }
+ 'A' + curlx_sltosi(conn->connection_id % 26),
+ (++imapc->cmdid)%1000);
+
+ /* start with a blank buffer */
+ Curl_dyn_reset(&imapc->dyn);
+
+ /* append tag + space + fmt */
+ result = Curl_dyn_addf(&imapc->dyn, "%s %s", imapc->resptag, fmt);
+ if(!result) {
+ va_list ap;
+ va_start(ap, fmt);
+ result = Curl_pp_vsendf(&imapc->pp, Curl_dyn_ptr(&imapc->dyn), ap);
+ va_end(ap);
+ }
return result;
}
@@ -1945,7 +1945,7 @@ static CURLcode imap_parse_url_path(struct connectdata *conn)
/* The imap struct is already initialised in imap_connect() */
CURLcode result = CURLE_OK;
struct Curl_easy *data = conn->data;
- struct IMAP *imap = data->req.p.imap;
+ struct IMAP *imap = data->req.p.imap;
const char *begin = &data->state.up.path[1]; /* skip leading slash */
const char *ptr = begin;
@@ -1960,7 +1960,7 @@ static CURLcode imap_parse_url_path(struct connectdata *conn)
end--;
result = Curl_urldecode(data, begin, end - begin, &imap->mailbox, NULL,
- REJECT_CTRL);
+ REJECT_CTRL);
if(result)
return result;
}
@@ -1982,8 +1982,8 @@ static CURLcode imap_parse_url_path(struct connectdata *conn)
return CURLE_URL_MALFORMAT;
/* Decode the name parameter */
- result = Curl_urldecode(data, begin, ptr - begin, &name, NULL,
- REJECT_CTRL);
+ result = Curl_urldecode(data, begin, ptr - begin, &name, NULL,
+ REJECT_CTRL);
if(result)
return result;
@@ -1993,8 +1993,8 @@ static CURLcode imap_parse_url_path(struct connectdata *conn)
ptr++;
/* Decode the value parameter */
- result = Curl_urldecode(data, begin, ptr - begin, &value, &valuelen,
- REJECT_CTRL);
+ result = Curl_urldecode(data, begin, ptr - begin, &value, &valuelen,
+ REJECT_CTRL);
if(result) {
free(name);
return result;
@@ -2077,12 +2077,12 @@ static CURLcode imap_parse_custom_request(struct connectdata *conn)
{
CURLcode result = CURLE_OK;
struct Curl_easy *data = conn->data;
- struct IMAP *imap = data->req.p.imap;
+ struct IMAP *imap = data->req.p.imap;
const char *custom = data->set.str[STRING_CUSTOMREQUEST];
if(custom) {
/* URL decode the custom request */
- result = Curl_urldecode(data, custom, 0, &imap->custom, NULL, REJECT_CTRL);
+ result = Curl_urldecode(data, custom, 0, &imap->custom, NULL, REJECT_CTRL);
/* Extract the parameters if specified */
if(!result) {