From d269265a68b0d6fd90304e98d3ecab5d699e9a15 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Sun, 13 Mar 2016 09:27:38 +0000 Subject: [PATCH] Removed commented out code from carddav/carddav-servercontact.cpp --- source/carddav/carddav-servercontact.cpp | 68 +----------------------- 1 file changed, 2 insertions(+), 66 deletions(-) diff --git a/source/carddav/carddav-servercontact.cpp b/source/carddav/carddav-servercontact.cpp index 3eda865..a5771c2 100644 --- a/source/carddav/carddav-servercontact.cpp +++ b/source/carddav/carddav-servercontact.cpp @@ -73,43 +73,13 @@ void CardDAV::GetServerContactData() ServerAddressNormal = wxT("http://") + ServerAddressURL; ServerAuth = ServerUser + wxT(":") + ServerPass; - - // Try SSL first. - - - /* - char *ServerAdrSSLChar = new char[(ServerAddressSSL.Length() - 1)]; - //memset(ServerAdrSSLChar, 0, ServerAddressSSL.Length()); - strncpy(ServerAdrSSLChar, (const char*)ServerAddressSSL.mb_str(wxConvUTF8), (ServerAddressSSL.Length() - 1)); - - char *ServerAdrNorChar = new char[(ServerAddressNormal.Length() - 1)]; - //memset(ServerAdrNorChar, 0, ServerAddressSSL.Length()); - strncpy(ServerAdrNorChar, (const char*)ServerAddressNormal.mb_str(wxConvUTF8), (ServerAddressNormal.Length() - 1)); - - char *ServerAuthChar = new char[(ServerAuth.Length() - 1)]; - //memset(ServerAuthChar, 0, ServerAddressSSL.Length()); - strncpy(ServerAuthChar, (const char*)ServerAuth.mb_str(wxConvUTF8), (ServerAuth.Length() - 1)); - - */ - - //std::string WriteDataString = std::string(ServerUploadData.mb_str()); std::map::iterator ActIter; struct UploadDataStruc UploadData; - ActIter = ActivityListPtr->find((int)ItemIndex); - - //ActIter->second = 1; - - /*wxString CardDAVDataQuery = wxT("\r\n"); - CardDAVDataQuery.Append(wxT("\r\n")); - CardDAVDataQuery.Append(wxT("\r\n")); - CardDAVDataQuery.Append(wxT("\r\n")); - CardDAVDataQuery.Append(wxT(" \r\n")); - CardDAVDataQuery.Append(wxT("\r\n")); - CardDAVDataQuery.Append(wxT(""));*/ + + // Try SSL first. if (ServerSSL){ @@ -124,12 +94,6 @@ void CardDAV::GetServerContactData() curl_easy_setopt(conn, CURLOPT_WRITEDATA, &PageData); curl_easy_setopt(conn, CURLOPT_WRITEHEADER, &PageHeader); curl_easy_setopt(conn, CURLOPT_NOSIGNAL, 1); - - //UploadData.readptr = &CardDAVDataQuery; - //UploadData.sizeleft = CardDAVDataQuery.Len(); - //curl_easy_setopt(conn, CURLOPT_UPLOAD, 1); - //curl_easy_setopt(conn, CURLOPT_READDATA, &UploadData); - //curl_easy_setopt(conn, CURLOPT_READFUNCTION, UploadReadFunc); ServerCertFilename = GetAccountDir(ServerAccount, TRUE); @@ -162,9 +126,6 @@ void CardDAV::GetServerContactData() curl_easy_setopt(conn, CURLOPT_WRITEDATA, &PageData); curl_easy_setopt(conn, CURLOPT_WRITEHEADER, &PageHeader); curl_easy_setopt(conn, CURLOPT_NOSIGNAL, 1); - - //UploadData.readptr = &CardDAVDataQuery; - //UploadData.sizeleft = CardDAVDataQuery.Len(); claconncode = (curl_easy_perform(conn)); @@ -186,15 +147,10 @@ void CardDAV::GetServerContactData() if (claconncode == CURLE_SSL_CACERT && wxFile::Exists(ServerCertFilename) == TRUE){ - //curl_easy_cleanup(conn); - //conn = curl_easy_init(); - CURL *sslerrconn; sslerrconn = curl_easy_init(); CURLcode sslerrconncode; - //claconncode = (curl_easy_perform(conn)); - wxString ServerAddressOnly = wxT("https://") + ServerAddress + wxT(":") + wxString::Format(wxT("%i"), ServerPort) + wxT("/"); curl_easy_setopt(sslerrconn, CURLOPT_URL, (const char*)ServerAddressOnly.mb_str(wxConvUTF8)); @@ -208,9 +164,6 @@ void CardDAV::GetServerContactData() curl_easy_setopt(sslerrconn, CURLOPT_WRITEDATA, &PageData); curl_easy_setopt(sslerrconn, CURLOPT_WRITEHEADER, &PageHeader); curl_easy_setopt(sslerrconn, CURLOPT_NOSIGNAL, 1); - - //UploadData.readptr = &CardDAVDataQuery; - //UploadData.sizeleft = CardDAVDataQuery.Len(); curl_easy_setopt(sslerrconn, CURLOPT_SSL_VERIFYPEER, 0); curl_easy_setopt(sslerrconn, CURLOPT_SSL_VERIFYHOST, 0); curl_easy_setopt(sslerrconn, CURLOPT_CERTINFO, 1); @@ -265,9 +218,6 @@ void CardDAV::GetServerContactData() curl_easy_setopt(conn, CURLOPT_WRITEDATA, &PageData); curl_easy_setopt(conn, CURLOPT_WRITEHEADER, &PageHeader); curl_easy_setopt(conn, CURLOPT_NOSIGNAL, 1); - - //UploadData.readptr = &CardDAVDataQuery; - //UploadData.sizeleft = CardDAVDataQuery.Len(); curl_easy_setopt(conn, CURLOPT_SSL_VERIFYHOST, 0); curl_easy_setopt(conn, CURLOPT_SSL_VERIFYPEER, 0); @@ -369,20 +319,6 @@ void CardDAV::GetServerContactData() curl_easy_setopt(conn, CURLOPT_WRITEHEADER, &PageHeader); curl_easy_setopt(conn, CURLOPT_NOSIGNAL, 1); - //UploadData.readptr = &CardDAVDataQuery; - //UploadData.sizeleft = CardDAVDataQuery.Len(); - //curl_easy_setopt(conn, CURLOPT_UPLOAD, 1); - //curl_easy_setopt(conn, CURLOPT_READDATA, &UploadData); - //curl_easy_setopt(conn, CURLOPT_READFUNCTION, UploadReadFunc); - - //UploadData.readptr = &CardDAVDataQuery; - //UploadData.sizeleft = CardDAVDataQuery.Len(); - //curl_easy_setopt(conn, CURLOPT_UPLOAD, 1); - //curl_easy_setopt(conn, CURLOPT_READDATA, &UploadData); - //curl_easy_setopt(conn, CURLOPT_READFUNCTION, UploadReadFunc); - - //curl_easy_setopt(conn, CURLOPT_WRITEFUNCTION, writefunc); - PageData.Clear(); PageHeader.Clear(); -- 2.39.5