X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Fobjects%2FCalDAV%2FCalDAV.cpp;h=c781e94b61f74bc22bb91f3dc0568bd23c23f5d3;hb=b6dd64930e7e2624c33b9a90bd9bed8c7f6d2391;hp=f0f8dc8a56f8c3bf9a05e576a8726e890e227631;hpb=4814657c80f09987a02c7842af6386fa33210c98;p=xestiacalendar%2F.git diff --git a/source/objects/CalDAV/CalDAV.cpp b/source/objects/CalDAV/CalDAV.cpp index f0f8dc8..c781e94 100644 --- a/source/objects/CalDAV/CalDAV.cpp +++ b/source/objects/CalDAV/CalDAV.cpp @@ -17,10 +17,21 @@ // with Xestia Calendar. If not, see #include "CalDAV.h" -#include using namespace std; +size_t CalDAVOutput(char *ReceivedBuffer, size_t Size, size_t NewMemoryBytes, string *StringPointer) +{ + + string ReceivedBufferString = ""; + ReceivedBufferString.append(ReceivedBuffer, NewMemoryBytes); + + StringPointer->append(ReceivedBufferString); + + return Size * NewMemoryBytes; + +} + CalDAV::CalDAV(){ // Setup the objects within the CalDAV connection @@ -77,6 +88,8 @@ CalDAVServerResult CalDAV::Connect(){ string ServerAddress = ""; string ServerUserPass = ""; + string ServerData = ""; + string ServerHeader = ""; // Setup the server address. @@ -108,11 +121,14 @@ CalDAVServerResult CalDAV::Connect(){ curl_easy_setopt(ConnectionHandle, CURLOPT_USERPWD, ServerUserPass.c_str()); curl_easy_setopt(ConnectionHandle, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST); curl_easy_setopt(ConnectionHandle, CURLOPT_FAILONERROR, 1L); - + curl_easy_setopt(ConnectionHandle, CURLOPT_WRITEFUNCTION, CalDAVOutput); + curl_easy_setopt(ConnectionHandle, CURLOPT_WRITEDATA, &ServerData); + curl_easy_setopt(ConnectionHandle, CURLOPT_WRITEHEADER, &ServerHeader); + // Connect to the CalDAV server. ServerResult.Code = curl_easy_perform(ConnectionHandle); - + // Process the result received from the server. if (ServerResult.Code != CURLE_OK){