From d48da3aa9bbe019af47eeb29f969634d7d03ea9f Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Tue, 12 Apr 2016 20:37:33 +0100 Subject: [PATCH] Added #defined(__APPLE__) around SetConnectionObject in the CardDAV object. --- source/carddav/carddav-connect.cpp | 4 ++++ source/carddav/carddav-contactlist.cpp | 4 ++++ source/carddav/carddav-defaultadrurl.cpp | 16 ++++++++++++++++ source/carddav/carddav-processdata.cpp | 8 ++++++++ source/carddav/carddav-servercontact.cpp | 8 ++++++++ source/carddav/carddav-serveretag.cpp | 8 ++++++++ source/carddav/carddav-sslverify.cpp | 12 ++++++++++-- 7 files changed, 58 insertions(+), 2 deletions(-) diff --git a/source/carddav/carddav-connect.cpp b/source/carddav/carddav-connect.cpp index 71134e7..3674e9a 100644 --- a/source/carddav/carddav-connect.cpp +++ b/source/carddav/carddav-connect.cpp @@ -131,8 +131,12 @@ bool CardDAV::Connect(){ curl_easy_setopt(conn, CURLOPT_SSL_VERIFYHOST, 0L); } +#if defined(__APPLE__) + SetConnectionObject(conn); +#endif + conncode = (curl_easy_perform(conn)); ptr.certdata = NULL; diff --git a/source/carddav/carddav-contactlist.cpp b/source/carddav/carddav-contactlist.cpp index 6c909ae..ab0cf09 100644 --- a/source/carddav/carddav-contactlist.cpp +++ b/source/carddav/carddav-contactlist.cpp @@ -51,7 +51,9 @@ ContactListData CardDAV::GetContactList(wxString SyncTokenInc){ conn = curl_easy_init(); #if defined(__APPLE__) + SetConnectionObject(conn); + #endif struct CardDAVCURLPasser { @@ -362,7 +364,9 @@ ContactListData CardDAV::GetContactList(wxString SyncTokenInc){ curl_easy_setopt(sslerrconn, CURLOPT_CERTINFO, 1); #if defined(__APPLE__) + SetConnectionObject(sslerrconn); + #endif sslerrconncode = (curl_easy_perform(sslerrconn)); diff --git a/source/carddav/carddav-defaultadrurl.cpp b/source/carddav/carddav-defaultadrurl.cpp index 6ed3aa5..b2fec75 100644 --- a/source/carddav/carddav-defaultadrurl.cpp +++ b/source/carddav/carddav-defaultadrurl.cpp @@ -50,8 +50,12 @@ wxString CardDAV::GetDefaultAddressBookURL(){ conn = curl_easy_init(); +#if defined(__APPLE__) + SetConnectionObject(conn); +#endif + struct curl_slist *connhd = NULL; struct curl_slist *connhd2 = NULL; struct curl_slist *connhd3 = NULL; @@ -168,8 +172,12 @@ wxString CardDAV::GetDefaultAddressBookURL(){ curl_easy_setopt(conn, CURLOPT_SSL_VERIFYHOST, 0L); } +#if defined(__APPLE__) + SetConnectionObject(conn); +#endif + conncode = (curl_easy_perform(conn)); if (conncode == CURLE_OK){ @@ -357,8 +365,12 @@ wxString CardDAV::GetDefaultAddressBookURL(){ curl_easy_setopt(conn, CURLOPT_SSL_VERIFYHOST, 0L); } +#if defined(__APPLE__) + SetConnectionObject(conn); +#endif + conncode = (curl_easy_perform(conn)); if (conncode == CURLE_OK){ @@ -535,8 +547,12 @@ wxString CardDAV::GetDefaultAddressBookURL(){ curl_easy_setopt(conn, CURLOPT_SSL_VERIFYHOST, 0L); } +#if defined(__APPLE__) + SetConnectionObject(conn); +#endif + conncode = (curl_easy_perform(conn)); if (conncode == CURLE_OK){ diff --git a/source/carddav/carddav-processdata.cpp b/source/carddav/carddav-processdata.cpp index 84f5144..55a353f 100644 --- a/source/carddav/carddav-processdata.cpp +++ b/source/carddav/carddav-processdata.cpp @@ -48,7 +48,11 @@ void CardDAV::ProcessDataThread(){ conn = curl_easy_init(); +#if defined(__APPLE__) + SetConnectionObject(conn); + +#endif struct CardDAVCURLPasser { @@ -341,9 +345,13 @@ void CardDAV::ProcessDataThread(){ curl_easy_setopt(sslerrconn, CURLOPT_NOSIGNAL, 1); curl_easy_setopt(sslerrconn, CURLOPT_SSL_VERIFYPEER, 0); curl_easy_setopt(sslerrconn, CURLOPT_CERTINFO, 1); + +#if defined(__APPLE__) SetConnectionObject(sslerrconn); +#endif + sslerrconncode = (curl_easy_perform(sslerrconn)); #if defined(__APPLE__) diff --git a/source/carddav/carddav-servercontact.cpp b/source/carddav/carddav-servercontact.cpp index b4d55e2..1ebc1df 100644 --- a/source/carddav/carddav-servercontact.cpp +++ b/source/carddav/carddav-servercontact.cpp @@ -52,7 +52,11 @@ void CardDAV::GetServerContactData() conn = curl_easy_init(); +#if defined(__APPLE__) + SetConnectionObject(conn); + +#endif struct CardDAVCURLPasser { @@ -286,8 +290,12 @@ void CardDAV::GetServerContactData() curl_easy_setopt(sslerrconn, CURLOPT_SSL_VERIFYPEER, 0); curl_easy_setopt(sslerrconn, CURLOPT_CERTINFO, 1); +#if defined(__APPLE__) + SetConnectionObject(sslerrconn); +#endif + sslerrconncode = (curl_easy_perform(sslerrconn)); SSLCertCol = BuildSSLCollection(sslerrconn); diff --git a/source/carddav/carddav-serveretag.cpp b/source/carddav/carddav-serveretag.cpp index 6ab608b..5ac3f27 100644 --- a/source/carddav/carddav-serveretag.cpp +++ b/source/carddav/carddav-serveretag.cpp @@ -50,8 +50,12 @@ void CardDAV::GetServerETagValueThread() conn = curl_easy_init(); +#if defined(__APPLE__) + SetConnectionObject(conn); +#endif + struct CardDAVCURLPasser { CardDAV *Data; @@ -321,8 +325,12 @@ void CardDAV::GetServerETagValueThread() sslerrconncode = (curl_easy_perform(sslerrconn)); +#if defined(__APPLE__) + SetConnectionObject(sslerrconn); +#endif + SSLCertCol = BuildSSLCollection(sslerrconn); SSLCertCol.SuccessCode = 1; diff --git a/source/carddav/carddav-sslverify.cpp b/source/carddav/carddav-sslverify.cpp index 9969c43..9418e5a 100644 --- a/source/carddav/carddav-sslverify.cpp +++ b/source/carddav/carddav-sslverify.cpp @@ -74,7 +74,11 @@ CURLcode CardDAV::SSLVerifyTest(){ curl_easy_setopt(conn, CURLOPT_WRITEDATA, &PageData); curl_easy_setopt(conn, CURLOPT_WRITEHEADER, &PageHeader); - SetConnectionObject(conn); +#if defined(__APPLE__) + + SetConnectionObject(conn); + +#endif conncode = (curl_easy_perform(conn)); @@ -103,8 +107,12 @@ CURLcode CardDAV::SSLVerifyTest(){ curl_easy_setopt(connssldata, CURLOPT_SSL_VERIFYPEER, 0L); curl_easy_setopt(connssldata, CURLOPT_SSL_VERIFYHOST, 0L); +#if defined(__APPLE__) + SetConnectionObject(connssldata); - + +#endif + CURLcode certfetchcode; certfetchcode = (curl_easy_perform(connssldata)); -- 2.39.5