@ -235,13 +235,16 @@ gboolean caldav_modify(caldav_settings* settings, caldav_error* error) {
* hoping for the best .
* hoping for the best .
*/
*/
else if ( lock_error . code = = 501 ) {
else if ( lock_error . code = = 501 ) {
lock_token = g_strdup ( " " ) ;
lock_error . code = 0 ;
g_free ( lock_error . str ) ;
lock_error . str = NULL ;
LOCKSUPPORT = FALSE ;
}
}
else {
else {
lock = - 1 ;
lock = - 1 ;
}
}
}
}
if ( ! LOCKSUPPORT | | ( LOCKSUPPORT & & lock_token & & lock_error . code ! = 423 ) ) {
if ( lock = = 0 ) {
curl_easy_setopt ( curl , CURLOPT_HTTPHEADER , http_header ) ;
curl_easy_setopt ( curl , CURLOPT_HTTPHEADER , http_header ) ;
curl_easy_setopt ( curl , CURLOPT_URL , rebuild_url ( settings , url ) ) ;
curl_easy_setopt ( curl , CURLOPT_URL , rebuild_url ( settings , url ) ) ;
curl_easy_setopt ( curl , CURLOPT_POSTFIELDS , settings - > file ) ;
curl_easy_setopt ( curl , CURLOPT_POSTFIELDS , settings - > file ) ;
@ -252,7 +255,7 @@ gboolean caldav_modify(caldav_settings* settings, caldav_error* error) {
curl_easy_setopt ( curl , CURLOPT_POSTREDIR , CURL_REDIR_POST_ALL ) ;
curl_easy_setopt ( curl , CURLOPT_POSTREDIR , CURL_REDIR_POST_ALL ) ;
curl_easy_setopt ( curl , CURLOPT_CUSTOMREQUEST , " PUT " ) ;
curl_easy_setopt ( curl , CURLOPT_CUSTOMREQUEST , " PUT " ) ;
res = curl_easy_perform ( curl ) ;
res = curl_easy_perform ( curl ) ;
if ( LOCKSUPPORT & & lock_token ) {
if ( LOCKSUPPORT ) {
caldav_unlock_object (
caldav_unlock_object (
lock_token , url , settings , & lock_error ) ;
lock_token , url , settings , & lock_error ) ;
}
}
@ -475,13 +478,13 @@ gboolean caldav_tasks_modify(caldav_settings* settings, caldav_error* error) {
* hoping for the best .
* hoping for the best .
*/
*/
else if ( lock_error . code = = 501 ) {
else if ( lock_error . code = = 501 ) {
lock_token = g_strdup ( " " ) ;
LOCKSUPPORT = FALSE ;
}
}
else {
else {
lock = - 1 ;
lock = - 1 ;
}
}
}
}
if ( ! LOCKSUPPORT | | ( LOCKSUPPORT & & lock_token & & lock_error . code ! = 423 ) ) {
if ( lock = = 0 ) {
curl_easy_setopt ( curl , CURLOPT_HTTPHEADER , http_header ) ;
curl_easy_setopt ( curl , CURLOPT_HTTPHEADER , http_header ) ;
curl_easy_setopt ( curl , CURLOPT_URL , rebuild_url ( settings , url ) ) ;
curl_easy_setopt ( curl , CURLOPT_URL , rebuild_url ( settings , url ) ) ;
curl_easy_setopt ( curl , CURLOPT_POSTFIELDS , settings - > file ) ;
curl_easy_setopt ( curl , CURLOPT_POSTFIELDS , settings - > file ) ;
@ -492,7 +495,7 @@ gboolean caldav_tasks_modify(caldav_settings* settings, caldav_error* error) {
curl_easy_setopt ( curl , CURLOPT_POSTREDIR , CURL_REDIR_POST_ALL ) ;
curl_easy_setopt ( curl , CURLOPT_POSTREDIR , CURL_REDIR_POST_ALL ) ;
curl_easy_setopt ( curl , CURLOPT_CUSTOMREQUEST , " PUT " ) ;
curl_easy_setopt ( curl , CURLOPT_CUSTOMREQUEST , " PUT " ) ;
res = curl_easy_perform ( curl ) ;
res = curl_easy_perform ( curl ) ;
if ( LOCKSUPPORT & & lock_token ) {
if ( LOCKSUPPORT ) {
caldav_unlock_object (
caldav_unlock_object (
lock_token , url , settings , & lock_error ) ;
lock_token , url , settings , & lock_error ) ;
}
}