1415
if (!curl)
1416
die("curl_easy_init failed");
1417
1418
- server_fill_credential(&server, cred);
1419
- curl_easy_setopt(curl, CURLOPT_USERNAME, server.user);
1420
- curl_easy_setopt(curl, CURLOPT_PASSWORD, server.pass);
1418
+ server_fill_credential(srvc, cred);
1419
+ curl_easy_setopt(curl, CURLOPT_USERNAME, srvc->user);
1420
+ curl_easy_setopt(curl, CURLOPT_PASSWORD, srvc->pass);
1421
1422
- strbuf_addstr(&path, server.use_ssl ? "imaps://" : "imap://");
1423
- strbuf_addstr(&path, server.host);
1422
+ strbuf_addstr(&path, srvc->use_ssl ? "imaps://" : "imap://");
1423
+ strbuf_addstr(&path, srvc->host);
1424
if (!path.len || path.buf[path.len - 1] != '/')
1425
strbuf_addch(&path, '/');
1426
1427
- uri_encoded_folder = curl_easy_escape(curl, server.folder, 0);
1427
+ uri_encoded_folder = curl_easy_escape(curl, srvc->folder, 0);
1428
if (!uri_encoded_folder)
1429
die("failed to encode server folder");
1430
strbuf_addstr(&path, uri_encoded_folder);
1432
1433
curl_easy_setopt(curl, CURLOPT_URL, path.buf);
1434
strbuf_release(&path);
1435
- curl_easy_setopt(curl, CURLOPT_PORT, server.port);
1435
+ curl_easy_setopt(curl, CURLOPT_PORT, srvc->port);
1436
1437
- if (server.auth_method) {
1437
+ if (srvc->auth_method) {
1438
#ifndef GIT_CURL_HAVE_CURLOPT_LOGIN_OPTIONS
1439
warning("No LOGIN_OPTIONS support in this cURL version");
1440
#else
1441
struct strbuf auth = STRBUF_INIT;
1442
strbuf_addstr(&auth, "AUTH=");
1443
- strbuf_addstr(&auth, server.auth_method);
1443
+ strbuf_addstr(&auth, srvc->auth_method);
1444
curl_easy_setopt(curl, CURLOPT_LOGIN_OPTIONS, auth.buf);
1445
strbuf_release(&auth);
1446
#endif
1447
}
1448
1449
- if (!server.use_ssl)
1449
+ if (!srvc->use_ssl)
1450
curl_easy_setopt(curl, CURLOPT_USE_SSL, (long)CURLUSESSL_TRY);
1451
1452
- curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, server.ssl_verify);
1453
- curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, server.ssl_verify);
1452
+ curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, srvc->ssl_verify);
1453
+ curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, srvc->ssl_verify);
1454
1455
curl_easy_setopt(curl, CURLOPT_READFUNCTION, fread_buffer);
1456