using namespace std;
CardDAV2::CardDAV2(string ServerAddress, int ServerPort, string ServerUser, string ServerPass, bool ServerSSL){
using namespace std;
CardDAV2::CardDAV2(string ServerAddress, int ServerPort, string ServerUser, string ServerPass, bool ServerSSL){
- CURL *Connection = GetConnectionObject();
- TLSCode = curl_easy_getinfo(Connection, CURLINFO_TLS_SSL_PTR, &TLSInfo);
+ TLSCode = curl_easy_getinfo(data->ConnectionSessionObject, CURLINFO_TLS_SSL_PTR, &TLSInfo);
COConnectResult ConnectResult = COCONNECT_UNITTESTFAIL;
string ServerAddressURL = BuildURL("/principals/");
COConnectResult ConnectResult = COCONNECT_UNITTESTFAIL;
string ServerAddressURL = BuildURL("/principals/");
curl_easy_setopt(ConnectionSession, CURLOPT_URL, ServerAddressURL.c_str());
curl_easy_setopt(ConnectionSession, CURLOPT_POSTFIELDS, SyncData.c_str());
curl_easy_setopt(ConnectionSession, CURLOPT_POSTFIELDSIZE, strlen(SyncData.c_str()));
curl_easy_setopt(ConnectionSession, CURLOPT_URL, ServerAddressURL.c_str());
curl_easy_setopt(ConnectionSession, CURLOPT_POSTFIELDS, SyncData.c_str());
curl_easy_setopt(ConnectionSession, CURLOPT_POSTFIELDSIZE, strlen(SyncData.c_str()));
PageHeaderObject.ConnectionSessionObject = ConnectionSession;
PageHeaderObject.DataSetting = &PageHeader;
PageHeaderObject.ServerUsingSSL = false;
PageHeaderObject.ConnectionSessionObject = ConnectionSession;
PageHeaderObject.DataSetting = &PageHeader;
PageHeaderObject.ServerUsingSSL = false;
curl_easy_setopt(ConnectionSession, CURLOPT_URL, ServerAddress.c_str());
curl_easy_setopt(ConnectionSession, CURLOPT_NOPROGRESS, 1L);
curl_easy_setopt(ConnectionSession, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST|CURLAUTH_BASIC);
curl_easy_setopt(ConnectionSession, CURLOPT_URL, ServerAddress.c_str());
curl_easy_setopt(ConnectionSession, CURLOPT_NOPROGRESS, 1L);
curl_easy_setopt(ConnectionSession, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST|CURLAUTH_BASIC);
curl_easy_setopt(ConnectionSession, CURLOPT_WRITEFUNCTION, CardDAV2::WritebackFunc);
curl_easy_setopt(ConnectionSession, CURLOPT_WRITEDATA, &PageDataObject);
curl_easy_setopt(ConnectionSession, CURLOPT_WRITEHEADER, &PageHeaderObject);
curl_easy_setopt(ConnectionSession, CURLOPT_WRITEFUNCTION, CardDAV2::WritebackFunc);
curl_easy_setopt(ConnectionSession, CURLOPT_WRITEDATA, &PageDataObject);
curl_easy_setopt(ConnectionSession, CURLOPT_WRITEHEADER, &PageHeaderObject);
curl_easy_setopt(ConnectionSession, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(ConnectionSession, CURLOPT_HTTPHEADER, nullptr);
curl_easy_setopt(ConnectionSession, CURLOPT_POSTFIELDS, nullptr);
curl_easy_setopt(ConnectionSession, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(ConnectionSession, CURLOPT_HTTPHEADER, nullptr);
curl_easy_setopt(ConnectionSession, CURLOPT_POSTFIELDS, nullptr);
PageHeaderObject.ConnectionSessionObject = ConnectionSession;
PageHeaderObject.DataSetting = &PageHeader;
PageHeaderObject.ServerUsingSSL = true;
PageHeaderObject.ConnectionSessionObject = ConnectionSession;
PageHeaderObject.DataSetting = &PageHeader;
PageHeaderObject.ServerUsingSSL = true;
curl_easy_setopt(ConnectionSession, CURLOPT_URL, ServerAddressURL.c_str());
curl_easy_setopt(ConnectionSession, CURLOPT_NOPROGRESS, 1L);
curl_easy_setopt(ConnectionSession, CURLOPT_URL, ServerAddressURL.c_str());
curl_easy_setopt(ConnectionSession, CURLOPT_NOPROGRESS, 1L);
curl_easy_setopt(ConnectionSession, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST|CURLAUTH_BASIC);
curl_easy_setopt(ConnectionSession, CURLOPT_TIMEOUT, 60);
curl_easy_setopt(ConnectionSession, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST|CURLAUTH_BASIC);
curl_easy_setopt(ConnectionSession, CURLOPT_TIMEOUT, 60);
curl_easy_setopt(ConnectionSession, CURLOPT_USERAGENT, XSDAB_USERAGENT);
curl_easy_setopt(ConnectionSession, CURLOPT_WRITEFUNCTION, CardDAV2::WritebackFunc);
curl_easy_setopt(ConnectionSession, CURLOPT_WRITEDATA, &PageDataObject);
curl_easy_setopt(ConnectionSession, CURLOPT_WRITEHEADER, &PageHeaderObject);
curl_easy_setopt(ConnectionSession, CURLOPT_ERRORBUFFER, SessionErrorBuffer);
curl_easy_setopt(ConnectionSession, CURLOPT_USERAGENT, XSDAB_USERAGENT);
curl_easy_setopt(ConnectionSession, CURLOPT_WRITEFUNCTION, CardDAV2::WritebackFunc);
curl_easy_setopt(ConnectionSession, CURLOPT_WRITEDATA, &PageDataObject);
curl_easy_setopt(ConnectionSession, CURLOPT_WRITEHEADER, &PageHeaderObject);
curl_easy_setopt(ConnectionSession, CURLOPT_ERRORBUFFER, SessionErrorBuffer);
- curl_easy_setopt(ConnectionSession, CURLOPT_NOSIGNAL, 1);
- curl_easy_setopt(ConnectionSession, CURLOPT_CERTINFO, 1);
- curl_easy_setopt(ConnectionSession, CURLOPT_VERBOSE, 1);
curl_easy_setopt(ConnectionSession, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(ConnectionSession, CURLOPT_HTTPHEADER, nullptr);
curl_easy_setopt(ConnectionSession, CURLOPT_POSTFIELDS, nullptr);
curl_easy_setopt(ConnectionSession, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(ConnectionSession, CURLOPT_HTTPHEADER, nullptr);
curl_easy_setopt(ConnectionSession, CURLOPT_POSTFIELDS, nullptr);
- curl_easy_setopt(ConnectionSession, CURLOPT_SSL_VERIFYHOST, 0);
- curl_easy_setopt(ConnectionSession, CURLOPT_SSL_VERIFYPEER, 0);
+ curl_easy_setopt(ConnectionSession, CURLOPT_SSL_VERIFYHOST, 0L);
+ curl_easy_setopt(ConnectionSession, CURLOPT_SSL_VERIFYPEER, 0L);
+ curl_easy_setopt(ConnectionSession, CURLOPT_SSL_VERIFYSTATUS, 0L);
- curl_easy_setopt(ConnectionSession, CURLOPT_SSL_VERIFYHOST, 2);
- curl_easy_setopt(ConnectionSession, CURLOPT_SSL_VERIFYPEER, 1);
+ curl_easy_setopt(ConnectionSession, CURLOPT_SSL_VERIFYHOST, 2L);
+ curl_easy_setopt(ConnectionSession, CURLOPT_SSL_VERIFYPEER, 1L);
+ curl_easy_setopt(ConnectionSession, CURLOPT_SSL_VERIFYSTATUS, 1L);