In case of error dirring a rename, mark the source as updated

That way, the file will be saved in the DB again, and the next try, it
will retry to rename
This commit is contained in:
Olivier Goffart 2013-02-12 15:11:15 +01:00
parent 79bbbe75d7
commit b028c64325
2 changed files with 7 additions and 3 deletions

View file

@ -1913,7 +1913,7 @@ static int owncloud_rename(const char *olduri, const char *newuri) {
} else {
set_errno_from_neon_errcode(rc);
if (rc != NE_OK && _progresscb) {
_progresscb(newuri, CSYNC_NOTIFY_ERROR, http_result_code_from_session(),
_progresscb(olduri, CSYNC_NOTIFY_ERROR, http_result_code_from_session(),
(long long)(dav_session.error_string) ,dav_session.userdata);
}
}

View file

@ -810,8 +810,12 @@ out:
/* set instruction for the statedb merger */
if (rc != 0) {
st->instruction = CSYNC_INSTRUCTION_ERROR;
if (other)
other->instruction = CSYNC_INSTRUCTION_ERROR;
if (other) {
other->instruction = CSYNC_INSTRUCTION_ERROR;
/* We set the instruction to UPDATED so next try we try to rename again */
st->instruction = CSYNC_INSTRUCTION_UPDATED;
}
}
return rc;