If file is not found, try to unlock
This commit is contained in:
parent
8e213f10fe
commit
e82cca6076
@ -10,6 +10,8 @@ ChangeLog for davfs2
|
||||
* cache.c:
|
||||
When upload fails temporarily: retry with
|
||||
increasing delays.
|
||||
* webdav.c, dav_delete:
|
||||
If file is not found, try to unlock.
|
||||
|
||||
2009-06-06 Werner Baumann (werner.baumann@onlinehome.de)
|
||||
* cache.c, dav_statfs:
|
||||
|
14
src/webdav.c
14
src/webdav.c
@ -572,17 +572,25 @@ dav_delete(const char *path, time_t *expire)
|
||||
if (ret) return ret;
|
||||
}
|
||||
|
||||
struct ne_lock *lock = NULL;
|
||||
char *spath = ne_path_escape(path);
|
||||
ret = ne_delete(session, spath);
|
||||
ret = get_error(ret, "DELETE");
|
||||
|
||||
if (ret == EACCES && lock_discover(spath, expire) == 0) {
|
||||
if ((ret == EACCES || ret == ENOENT) && locks) {
|
||||
lock_discover(spath, expire);
|
||||
lock = lock_by_path(spath);
|
||||
if (lock && ret == EACCES) {
|
||||
ret = ne_delete(session, spath);
|
||||
ret = get_error(ret, "DELETE");
|
||||
} else if (lock) {
|
||||
ne_unlock(session, lock);
|
||||
ret = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (!ret && locks && *expire) {
|
||||
struct ne_lock *lock = lock_by_path(spath);
|
||||
if (!ret && locks) {
|
||||
lock = lock_by_path(spath);
|
||||
if (lock) {
|
||||
ne_lockstore_remove(locks, lock);
|
||||
ne_lock_destroy(lock);
|
||||
|
Loading…
Reference in New Issue
Block a user