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:
|
* cache.c:
|
||||||
When upload fails temporarily: retry with
|
When upload fails temporarily: retry with
|
||||||
increasing delays.
|
increasing delays.
|
||||||
|
* webdav.c, dav_delete:
|
||||||
|
If file is not found, try to unlock.
|
||||||
|
|
||||||
2009-06-06 Werner Baumann (werner.baumann@onlinehome.de)
|
2009-06-06 Werner Baumann (werner.baumann@onlinehome.de)
|
||||||
* cache.c, dav_statfs:
|
* 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;
|
if (ret) return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct ne_lock *lock = NULL;
|
||||||
char *spath = ne_path_escape(path);
|
char *spath = ne_path_escape(path);
|
||||||
ret = ne_delete(session, spath);
|
ret = ne_delete(session, spath);
|
||||||
ret = get_error(ret, "DELETE");
|
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 = ne_delete(session, spath);
|
||||||
ret = get_error(ret, "DELETE");
|
ret = get_error(ret, "DELETE");
|
||||||
|
} else if (lock) {
|
||||||
|
ne_unlock(session, lock);
|
||||||
|
ret = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ret && locks && *expire) {
|
if (!ret && locks) {
|
||||||
struct ne_lock *lock = lock_by_path(spath);
|
lock = lock_by_path(spath);
|
||||||
if (lock) {
|
if (lock) {
|
||||||
ne_lockstore_remove(locks, lock);
|
ne_lockstore_remove(locks, lock);
|
||||||
ne_lock_destroy(lock);
|
ne_lock_destroy(lock);
|
||||||
|
Loading…
Reference in New Issue
Block a user