mirror of
https://github.com/sigoden/dufs.git
synced 2026-06-07 15:59:03 +03:00
[PR #704] feat: real WebDAV LOCK/UNLOCK with in-memory lock enforcement #4808
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/sigoden/dufs/pull/704
Author: @image72
Created: 5/13/2026
Status: 🔄 Open
Base:
main← Head:feat/real-webdav-locking📝 Commits (3)
16ba3a9feat: real WebDAV LOCK/UNLOCK with in-memory lock enforcementaa7dd4afeat: lock lifecycle management - DELETE/MOVE cleanup + timeout support + 23 testsb7a770bfix: litmus lock compliance — 24/26 tests pass📊 Changes
5 files changed (+742 additions, -16 deletions)
View changed files
➕
.cargo/config.toml(+5 -0)📝
src/server.rs(+403 -13)📝
tests/http.rs(+1 -1)➕
tests/lock.rs(+318 -0)📝
tests/webdav.rs(+15 -2)📄 Description
Summary
LockManagertests/lock.rscovering all lock workflowsChanges
Real locking infrastructure
LockManager: thread-safe lock registry (RwLock<HashMap<String, Vec<LockInfo>>>)LockInfo: stores token, scope (exclusive/shared), timeout, created_atLockManager::refresh()for lock renewal viaIf:headerLOCK improvements
Timeoutheader support: parseSecond-NandInfinite, respond with granted timeoutcleanup_expired()called onacquire(lazy GC)is_expired()filters expired entries inis_locked(read path)Lock enforcement on write operations
If:header lock token extraction for owner bypassIf:token on unlocked resourceLock lifecycle management
remove_all()cleans locks on deleted resourceremove_all()cleans locks on source after renameLock-Tokenheader, returns 409 on mismatchAllow/DAV headers
Allownow includesPROPPATCH, MKCOL, LOCK, UNLOCKDAV: 1, 2, 3unchanged (already declared)litmus test results
Files changed
src/server.rs: +350/-30tests/lock.rs: new, 23 teststests/http.rs: update Allow header assertiontests/webdav.rs: update lock/unlock tests.cargo/config.toml: cross-compilation linker config🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.