// with Xestia Calendar. If not, see <http://www.gnu.org/licenses/>
#include "CalDAV.h"
-#include <iostream>
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
ConnectionStatus.Username = ConnectionData.Username;
ConnectionStatus.Prefix = ConnectionData.Prefix;
ConnectionStatus.UseSSL = ConnectionData.UseSSL;
+ ConnectionStatus.Timeout = ConnectionData.Timeout;
return ConnectionStatus;
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_TIMEOUT, ConnectionData.Timeout);
curl_easy_setopt(ConnectionHandle, CURLOPT_WRITEFUNCTION, CalDAVOutput);
curl_easy_setopt(ConnectionHandle, CURLOPT_WRITEDATA, &ServerData);
curl_easy_setopt(ConnectionHandle, CURLOPT_WRITEHEADER, &ServerHeader);