@@ -137,12 +137,10 @@ struct imap_store {
137
137
};
138
138
139
139
struct imap_cmd_cb {
140
- int (* cont )(struct imap_store * ctx , struct imap_cmd * cmd , const char * prompt );
141
- void (* done )(struct imap_store * ctx , struct imap_cmd * cmd , int response );
140
+ int (* cont )(struct imap_store * ctx , const char * prompt );
142
141
void * ctx ;
143
142
char * data ;
144
143
int dlen ;
145
- int uid ;
146
144
};
147
145
148
146
struct imap_cmd {
@@ -786,7 +784,7 @@ static int get_cmd_result(struct imap_store *ctx, struct imap_cmd *tcmd)
786
784
if (n != (int )cmdp -> cb .dlen )
787
785
return RESP_BAD ;
788
786
} else if (cmdp -> cb .cont ) {
789
- if (cmdp -> cb .cont (ctx , cmdp , cmd ))
787
+ if (cmdp -> cb .cont (ctx , cmd ))
790
788
return RESP_BAD ;
791
789
} else {
792
790
fprintf (stderr , "IMAP error: unexpected command continuation request\n" );
@@ -828,8 +826,6 @@ static int get_cmd_result(struct imap_store *ctx, struct imap_cmd *tcmd)
828
826
}
829
827
if ((resp2 = parse_response_code (ctx , & cmdp -> cb , cmd )) > resp )
830
828
resp = resp2 ;
831
- if (cmdp -> cb .done )
832
- cmdp -> cb .done (ctx , cmdp , resp );
833
829
free (cmdp -> cb .data );
834
830
free (cmdp -> cmd );
835
831
free (cmdp );
@@ -917,7 +913,7 @@ static char *cram(const char *challenge_64, const char *user, const char *pass)
917
913
918
914
#endif
919
915
920
- static int auth_cram_md5 (struct imap_store * ctx , struct imap_cmd * cmd , const char * prompt )
916
+ static int auth_cram_md5 (struct imap_store * ctx , const char * prompt )
921
917
{
922
918
int ret ;
923
919
char * response ;
@@ -1416,42 +1412,42 @@ static CURL *setup_curl(struct imap_server_conf *srvc, struct credential *cred)
1416
1412
if (!curl )
1417
1413
die ("curl_easy_init failed" );
1418
1414
1419
- server_fill_credential (& server , cred );
1420
- curl_easy_setopt (curl , CURLOPT_USERNAME , server . user );
1421
- curl_easy_setopt (curl , CURLOPT_PASSWORD , server . pass );
1415
+ server_fill_credential (srvc , cred );
1416
+ curl_easy_setopt (curl , CURLOPT_USERNAME , srvc -> user );
1417
+ curl_easy_setopt (curl , CURLOPT_PASSWORD , srvc -> pass );
1422
1418
1423
- strbuf_addstr (& path , server . use_ssl ? "imaps://" : "imap://" );
1424
- strbuf_addstr (& path , server . host );
1419
+ strbuf_addstr (& path , srvc -> use_ssl ? "imaps://" : "imap://" );
1420
+ strbuf_addstr (& path , srvc -> host );
1425
1421
if (!path .len || path .buf [path .len - 1 ] != '/' )
1426
1422
strbuf_addch (& path , '/' );
1427
1423
1428
- uri_encoded_folder = curl_easy_escape (curl , server . folder , 0 );
1424
+ uri_encoded_folder = curl_easy_escape (curl , srvc -> folder , 0 );
1429
1425
if (!uri_encoded_folder )
1430
1426
die ("failed to encode server folder" );
1431
1427
strbuf_addstr (& path , uri_encoded_folder );
1432
1428
curl_free (uri_encoded_folder );
1433
1429
1434
1430
curl_easy_setopt (curl , CURLOPT_URL , path .buf );
1435
1431
strbuf_release (& path );
1436
- curl_easy_setopt (curl , CURLOPT_PORT , server . port );
1432
+ curl_easy_setopt (curl , CURLOPT_PORT , srvc -> port );
1437
1433
1438
- if (server . auth_method ) {
1434
+ if (srvc -> auth_method ) {
1439
1435
#ifndef GIT_CURL_HAVE_CURLOPT_LOGIN_OPTIONS
1440
1436
warning ("No LOGIN_OPTIONS support in this cURL version" );
1441
1437
#else
1442
1438
struct strbuf auth = STRBUF_INIT ;
1443
1439
strbuf_addstr (& auth , "AUTH=" );
1444
- strbuf_addstr (& auth , server . auth_method );
1440
+ strbuf_addstr (& auth , srvc -> auth_method );
1445
1441
curl_easy_setopt (curl , CURLOPT_LOGIN_OPTIONS , auth .buf );
1446
1442
strbuf_release (& auth );
1447
1443
#endif
1448
1444
}
1449
1445
1450
- if (!server . use_ssl )
1446
+ if (!srvc -> use_ssl )
1451
1447
curl_easy_setopt (curl , CURLOPT_USE_SSL , (long )CURLUSESSL_TRY );
1452
1448
1453
- curl_easy_setopt (curl , CURLOPT_SSL_VERIFYPEER , server . ssl_verify );
1454
- curl_easy_setopt (curl , CURLOPT_SSL_VERIFYHOST , server . ssl_verify );
1449
+ curl_easy_setopt (curl , CURLOPT_SSL_VERIFYPEER , srvc -> ssl_verify );
1450
+ curl_easy_setopt (curl , CURLOPT_SSL_VERIFYHOST , srvc -> ssl_verify );
1455
1451
1456
1452
curl_easy_setopt (curl , CURLOPT_READFUNCTION , fread_buffer );
1457
1453
0 commit comments