X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Fobjects%2FCalDAV%2FCalDAV.cpp;h=964f28691710bd9f65ba74e64c05025ce420f5e1;hb=f3908f3b7bf98079d82fde9d2180c337f565d8c6;hp=545c10808110b5725122b84aeefd729bc6858a93;hpb=ddd1ca72930b22d2dc221b1e315789b14f0ca837;p=xestiacalendar%2F.git diff --git a/source/objects/CalDAV/CalDAV.cpp b/source/objects/CalDAV/CalDAV.cpp index 545c108..964f286 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 @@ -66,6 +77,7 @@ CalDAVStatus CalDAV::GetConnectionData(){ ConnectionStatus.Username = ConnectionData.Username; ConnectionStatus.Prefix = ConnectionData.Prefix; ConnectionStatus.UseSSL = ConnectionData.UseSSL; + ConnectionStatus.Timeout = ConnectionData.Timeout; return ConnectionStatus; @@ -110,6 +122,7 @@ 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_TIMEOUT, ConnectionData.Timeout); curl_easy_setopt(ConnectionHandle, CURLOPT_WRITEFUNCTION, CalDAVOutput); curl_easy_setopt(ConnectionHandle, CURLOPT_WRITEDATA, &ServerData); curl_easy_setopt(ConnectionHandle, CURLOPT_WRITEHEADER, &ServerHeader);