size_t CalDAVSend(char *sendBuffer, size_t size, size_t newMemoryBytes, void *dataStruct){
- struct CalDAVSendData *uploadPtr = (struct calDAVSendData *)dataStruct;
+ struct CalDAVSendData *uploadPtr = (struct CalDAVSendData *)dataStruct;
if (uploadPtr->sizeleft){
// Setup the server password.
- ServerUserPass += connectionData.username;
- ServerUserPass += ":";
- ServerUserPass += connectionData.password;
+ serverUserPass += connectionData.username;
+ serverUserPass += ":";
+ serverUserPass += connectionData.password;
curl_easy_setopt(connectionHandle, CURLOPT_URL, serverAddress.c_str());
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, calDAVReceive);
+ curl_easy_setopt(connectionHandle, CURLOPT_WRITEFUNCTION, CalDAVReceive);
curl_easy_setopt(connectionHandle, CURLOPT_WRITEDATA, &serverData);
curl_easy_setopt(connectionHandle, CURLOPT_WRITEHEADER, &serverHeader);
curl_easy_setopt(connectionHandle, CURLOPT_CUSTOMREQUEST, "PROPFIND");
curl_easy_setopt(connectionHandle, CURLOPT_UPLOAD, 1L);
curl_easy_setopt(connectionHandle, CURLOPT_READDATA, &userPrincipalSendData);
- curl_easy_setopt(connectionHandle, CURLOPT_READFUNCTION, calDAVSend);
+ curl_easy_setopt(connectionHandle, CURLOPT_READFUNCTION, CalDAVSend);
// Process the data.
// Set the results.
if (serverResult == CURLE_OK){
- connectionServerResult.Result = CALDAVQUERYRESULT_OK;
+ connectionServerResult.result = CALDAVQUERYRESULT_OK;
} else {
- connectionServerResult.Result = CALDAVQUERYRESULT_SERVERERROR;
+ connectionServerResult.result = CALDAVQUERYRESULT_SERVERERROR;
}
- connectionServerResult.Code = serverResult;
- curl_easy_getinfo(connectionHandle, CURLINFO_RESPONSE_CODE, &connectionServerResult.HTTPCode);
+ connectionServerResult.code = serverResult;
+ curl_easy_getinfo(connectionHandle, CURLINFO_RESPONSE_CODE, &connectionServerResult.httpCode);
if (serverResult != CURLE_OK){
curl_easy_setopt(connectionHandle, CURLOPT_CUSTOMREQUEST, "PROPFIND");
curl_easy_setopt(connectionHandle, CURLOPT_UPLOAD, 1L);
curl_easy_setopt(connectionHandle, CURLOPT_READDATA, &calendarHomeSendData);
- curl_easy_setopt(connectionHandle, CURLOPT_READFUNCTION, calDAVSend);
+ curl_easy_setopt(connectionHandle, CURLOPT_READFUNCTION, CalDAVSend);
// Process the data.
curl_easy_setopt(connectionHandle, CURLOPT_CUSTOMREQUEST, "PROPFIND");
curl_easy_setopt(connectionHandle, CURLOPT_UPLOAD, 1L);
curl_easy_setopt(connectionHandle, CURLOPT_READDATA, &calendarListSendData);
- curl_easy_setopt(connectionHandle, CURLOPT_READFUNCTION, calDAVSend);
+ curl_easy_setopt(connectionHandle, CURLOPT_READFUNCTION, CalDAVSend);
// Process the data.
connectionServerResult.code = serverResult;
curl_easy_getinfo(connectionHandle, CURLINFO_RESPONSE_CODE, &connectionServerResult.httpCode);
- if (cerverResult != CURLE_OK){
+ if (serverResult != CURLE_OK){
return serverList;
curl_easy_setopt(connectionHandle, CURLOPT_CUSTOMREQUEST, "REPORT");
curl_easy_setopt(connectionHandle, CURLOPT_UPLOAD, 1L);
curl_easy_setopt(connectionHandle, CURLOPT_READDATA, &entryListSendData);
- curl_easy_setopt(connectionHandle, CURLOPT_READFUNCTION, calDAVSend);
+ curl_easy_setopt(connectionHandle, CURLOPT_READFUNCTION, CalDAVSend);
// Process the data.
curl_easy_setopt(connectionHandle, CURLOPT_CUSTOMREQUEST, "REPORT");
curl_easy_setopt(connectionHandle, CURLOPT_UPLOAD, 1L);
curl_easy_setopt(connectionHandle, CURLOPT_READDATA, &entryListSendData);
- curl_easy_setopt(connectionHandle, CURLOPT_READFUNCTION, calDAVSend);
+ curl_easy_setopt(connectionHandle, CURLOPT_READFUNCTION, CalDAVSend);
// Process the data.
curl_easy_setopt(connectionHandle, CURLOPT_CUSTOMREQUEST, "REPORT");
curl_easy_setopt(connectionHandle, CURLOPT_UPLOAD, 1L);
curl_easy_setopt(connectionHandle, CURLOPT_READDATA, &updatedEntryListSendData);
- curl_easy_setopt(connectionHandle, CURLOPT_READFUNCTION, calDAVSend);
+ curl_easy_setopt(connectionHandle, CURLOPT_READFUNCTION, CalDAVSend);
// Get the updated calendar data.
if (userPrincipalURI.size() == 0){
- return ServerResult;
+ return serverResult;
}
curl_easy_setopt(connectionHandle, CURLOPT_CUSTOMREQUEST, "MKCALENDAR");
curl_easy_setopt(connectionHandle, CURLOPT_UPLOAD, 1L);
curl_easy_setopt(connectionHandle, CURLOPT_READDATA, &calendarAddSendData);
- curl_easy_setopt(connectionHandle, CURLOPT_READFUNCTION, calDAVSend);
+ curl_easy_setopt(connectionHandle, CURLOPT_READFUNCTION, CalDAVSend);
// Process the data.
curl_easy_setopt(connectionHandle, CURLOPT_CUSTOMREQUEST, "PROPPATCH");
curl_easy_setopt(connectionHandle, CURLOPT_UPLOAD, 1L);
curl_easy_setopt(connectionHandle, CURLOPT_READDATA, &calendarEditSendData);
- curl_easy_setopt(connectionHandle, CURLOPT_READFUNCTION, calDAVSend);
+ curl_easy_setopt(connectionHandle, CURLOPT_READFUNCTION, CalDAVSend);
// Process the data.
CURLcode serverConnectionResult = curl_easy_perform(connectionHandle);
- if (serverConnectionRsult == CURLE_OK){
+ if (serverConnectionResult == CURLE_OK){
serverResult.result = CALDAVQUERYRESULT_OK;
} else {
serverResult.result = CALDAVQUERYRESULT_SERVERERROR;
curl_easy_setopt(connectionHandle, CURLOPT_READDATA, NULL);
curl_easy_setopt(connectionHandle, CURLOPT_READFUNCTION, NULL);
- return ServerResult;
+ return serverResult;
}
}
-CalDAVServerResult CalDAV::EditCalendar(string *CalendarHREF,
- Colour *CalendarColour){
-
+CalDAVServerResult CalDAV::EditCalendar(string *calendarHREF,
+ Colour *calendarColour){
CalDAVServerResult serverResult;
CURLcode serverConnectionResult = curl_easy_perform(connectionHandle);
if (serverConnectionResult == CURLE_OK){
- serverResult.Result = CALDAVQUERYRESULT_OK;
+ serverResult.result = CALDAVQUERYRESULT_OK;
} else {
- serverResult.Result = CALDAVQUERYRESULT_SERVERERROR;
+ serverResult.result = CALDAVQUERYRESULT_SERVERERROR;
}
serverResult.code = serverConnectionResult;
curl_easy_getinfo(connectionHandle, CURLINFO_RESPONSE_CODE, &serverResult.httpCode);
curl_easy_setopt(connectionHandle, CURLOPT_CUSTOMREQUEST, "REPORT");
curl_easy_setopt(connectionHandle, CURLOPT_UPLOAD, 1L);
curl_easy_setopt(connectionHandle, CURLOPT_READDATA, &entryETagGetData);
- curl_easy_setopt(connectionHandle, CURLOPT_READFUNCTION, calDAVSend);
+ curl_easy_setopt(connectionHandle, CURLOPT_READFUNCTION, CalDAVSend);
// Attempt to get the entity tag.
curl_easy_setopt(connectionHandle, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(connectionHandle, CURLOPT_UPLOAD, 1L);
curl_easy_setopt(connectionHandle, CURLOPT_READDATA, &entryAddSendData);
- curl_easy_setopt(connectionHandle, CURLOPT_READFUNCTION, calDAVSend);
+ curl_easy_setopt(connectionHandle, CURLOPT_READFUNCTION, CalDAVSend);
// Process the data.
curl_easy_setopt(connectionHandle, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(connectionHandle, CURLOPT_UPLOAD, 1L);
curl_easy_setopt(connectionHandle, CURLOPT_READDATA, &entryAddSendData);
- curl_easy_setopt(connectionHandle, CURLOPT_READFUNCTION, calDAVSend);
+ curl_easy_setopt(connectionHandle, CURLOPT_READFUNCTION, CalDAVSend);
// Process the data.