Branch: Tag:

2018-04-10

2018-04-10 12:33:13 by Henrik Grubbström (Grubba) <grubba@grubba.org>

WebDAV: Survive unregister_lock() on already unregistered lock.

Fixes backtrace when expire_locks() attempts to unlock a lock
that has already been unregistered via unlock_path().

931:       string rsc = resource_id(path, id);    +  // NB: The following code leaves dead locks in conf->active_locks! +     foreach(file_locks; string prefix; mapping(mixed:DAVLock) sub_locks) {    if (has_prefix(prefix, rsc)) {    TRACE_ENTER(sprintf("Unlocking %d locks for path %O...",
1027:    }    }    } -  if (!sizeof (prefix_locks[path])) m_delete (prefix_locks, path); +  if (prefix_locks[path] && !sizeof (prefix_locks[path])) { +  m_delete(prefix_locks, path);    } -  +  }    else if (file_locks[path]) {    if (id) {    removed_lock = m_delete (file_locks[path], auth_user);