SyncData.Append(wxT("<D:sync-collection xmlns:D=\"DAV:\"\n"));
SyncData.Append(wxT(" xmlns:C=\"urn:ietf:params:xml:ns:carddav\">\n"));
SyncData.Append(wxT("<D:sync-token>"));
- //SyncData.Trim();
- //SyncData.Append(wxT("data:,00378c55-1f44-44a2-a255-84f6560b5cac_580"));
SyncData.Append(SyncTokenInc);
- //SyncData.Trim();
SyncData.Append(wxT("</D:sync-token>\n"));
SyncData.Append(wxT("<D:sync-level>1</D:sync-level>\n"));
SyncData.Append(wxT("<D:prop>\n"));
SyncDataBuffer = SyncData.ToUTF8();
}
-
- //static const char* query = SyncData.mb_str();
-
- /*char *query = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\
- <D:sync-collection xmlns:D=\"DAV:\"\n\
- xmlns:C=\"urn:ietf:params:xml:ns:carddav\">\n\
- <D:sync-token>data:,00378c55-1f44-44a2-a255-84f6560b5cac_580</D:sync-token>\n\
- <D:sync-level>1</D:sync-level>\n\
- <D:prop>\n\
- <D:getetag/>\n\
- </D:prop>\n\
- </D:sync-collection>\n";*/
+
const char* query = SyncDataBuffer.data();
// Try SSL first.
}
- //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);
curl_easy_setopt(conn, CURLOPT_POSTFIELDS, query);
curl_easy_setopt(conn, CURLOPT_POSTFIELDSIZE, strlen(query));
// the certificates as PEM files.
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));
curl_easy_setopt(conn, CURLOPT_CUSTOMREQUEST, "REPORT");
curl_easy_setopt(conn, CURLOPT_NOSIGNAL, 1);
curl_easy_setopt(conn, CURLOPT_HTTPHEADER, slist);
-
- //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);
curl_easy_setopt(conn, CURLOPT_POSTFIELDS, query);
curl_easy_setopt(conn, CURLOPT_POSTFIELDSIZE, strlen(query));
SleepFor(2000000000);
- /*timespec n1, n2;
-
- n1.tv_sec = 0;
- n1.tv_nsec = 2000000000L;
-
- nanosleep(&n1, &n2);*/
-
xmlFreeDoc(xmlCardDAVDoc);
curl_easy_cleanup(conn);