Defined in
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
-
No testcase defined.
Source code:
regsub {^/} $uri {} uri
if {[file exists [tdav::get_lock_file $uri]]} {
set lockinfo [tdav::read_lock $uri]
if {[tdav::lock_timeout_left [lindex $lockinfo 4] [lindex $lockinfo 6]] == 0 } {
tdav::remove_lock $uri
return "unlocked"
}
set hdr [ns_set iget [ns_conn headers] If]
if {[info exists hdr] && [string length $hdr]} {
set token ""
regexp {(<https?://[^/]+([^>]+)>\s+)?\(<([^>]+)>\)} $hdr nil maybe hdr_uri token
set ftk [lindex $lockinfo 3]
if {![info exists token] || $token ne $ftk } {
ns_log Debug "tdav::check_lock: token mismatch $ftk expected hdr: $hdr token: $token"
ns_return 423 {text/plain} {}
return filter_return
}
} else {
ns_log Debug "tdav::check_lock: no \"If\" header found for request of $uri"
ns_return 423 {text/plain} {}
return filter_return
}
}
return unlocked
XQL Not present:Generic, PostgreSQL, Oracle