Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Moved resetting and result processing code in CalDAV::GetCalendars()
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sat, 23 Apr 2016 23:35:55 +0000 (00:35 +0100)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sat, 23 Apr 2016 23:35:55 +0000 (00:35 +0100)
source/objects/CalDAV/CalDAV.cpp

index 3d2e5de..a2bb856 100644 (file)
@@ -511,17 +511,13 @@ CalDAVCalendarList CalDAV::GetCalendars(){
        
        //ServerList = ProcessXMLCalendarList();
        
-       // Restore the original settings.
-       
-       string OriginalServerAddress = BuildServerAddress(&ConnectionData, "/principals");
-       curl_easy_setopt(ConnectionHandle, CURLOPT_URL, OriginalServerAddress.c_str());
-       curl_easy_setopt(ConnectionHandle, CURLOPT_CUSTOMREQUEST, NULL);        
-       curl_easy_setopt(ConnectionHandle, CURLOPT_UPLOAD, 0L);
-       curl_easy_setopt(ConnectionHandle, CURLOPT_READDATA, NULL);
-       curl_easy_setopt(ConnectionHandle, CURLOPT_READFUNCTION, NULL);
-       
-       // Process the received XML data into a list of calendars
-       // and locations.
+       if (ServerResult == CURLE_OK){
+               ConnectionServerResult.Result = CALDAVQUERYRESULT_OK;
+       } else {
+               ConnectionServerResult.Result = CALDAVQUERYRESULT_SERVERERROR;          
+       }
+       ConnectionServerResult.Code = ServerResult;
+       curl_easy_getinfo(ConnectionHandle, CURLINFO_RESPONSE_CODE, &ConnectionServerResult.HTTPCode);
        
        if (ServerResult != CURLE_OK){
                
@@ -529,8 +525,21 @@ CalDAVCalendarList CalDAV::GetCalendars(){
                
        }
        
+       // Process the received XML data into a list of calendars
+       // and locations.
+       
        ServerList = ProcessXMLCalendarList();
        
+       // Restore the original settings.
+       
+       string OriginalServerAddress = BuildServerAddress(&ConnectionData, "/principals/");
+       
+       curl_easy_setopt(ConnectionHandle, CURLOPT_URL, OriginalServerAddress.c_str());
+       curl_easy_setopt(ConnectionHandle, CURLOPT_CUSTOMREQUEST, NULL);        
+       curl_easy_setopt(ConnectionHandle, CURLOPT_UPLOAD, 0L);
+       curl_easy_setopt(ConnectionHandle, CURLOPT_READDATA, NULL);
+       curl_easy_setopt(ConnectionHandle, CURLOPT_READFUNCTION, NULL);
+       
        return ServerList;
        
 }
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy