Roxen.git
/
server
/
base_server
/
module.pike
version
»
Context lines:
10
20
40
80
file
none
3
Roxen.git/server/base_server/module.pike:1:
// This file is part of Roxen WebServer. // Copyright © 1996 - 2004, Roxen IS.
-
//
$Id: module.pike,v 1.234 2008/12/11 17:17:43 jonasw Exp $
+
//
$Id$
#include <module_constants.h> #include <module.h> #include <request_trace.h> constant __pragma_save_parent__ = 1; // Tell Pike.count_memory this is global. constant pike_cycle_depth = 0;
Roxen.git/server/base_server/module.pike:792:
foreach (prefix_locks; PATH; LOCKS) {CODE;} \ } while (0) //! Find some or all locks that apply to @[path]. //! //! @param path //! Normalized path below the filesystem location. //! //! @param recursive //! If @expr{1@} also return locks anywhere below @[path].
+
//! If @expr{-1} return locks anywhere below @[path], but not
+
//! any above @[path]. (This is appropriate to use to get the
+
//! list of locks that need to be unlocked on DELETE.)
//! //! @param exclude_shared //! If @expr{1@} do not return shared locks that are held by users //! other than the one the request is authenticated as. (This is //! appropriate to get the list of locks that would conflict if the //! current user were to make a shared lock.) //! //! @returns //! Returns a multiset containing all applicable locks in //! this location module, or @expr{0@} (zero) if there are none. //! //! @note //! @[DAVLock] objects may be created if the filesystem has some //! persistent storage of them. The default implementation does not //! store locks persistently. //! //! @note //! The default implementation only handles the @expr{"DAV:write"@} //! lock type. multiset(DAVLock) find_locks(string path,
-
int(
0
..1) recursive,
+
int(
-1
..1) recursive,
int(0..1) exclude_shared, RequestID id) { // Common case. if (!sizeof(file_locks) && !sizeof(prefix_locks)) return 0; TRACE_ENTER(sprintf("find_locks(%O, %O, %O, X)", path, recursive, exclude_shared), this); string rsc = resource_id (path, id);
Roxen.git/server/base_server/module.pike:845:
} else add_locks = lambda (mapping(mixed:DAVLock) sub_locks) { locks |= mkmultiset (values (sub_locks)); }; if (file_locks[rsc]) { add_locks (file_locks[rsc]); }
+
if (recursive >= 0) {
foreach(prefix_locks; string prefix; mapping(mixed:DAVLock) sub_locks) { if (has_prefix(rsc, prefix)) { add_locks (sub_locks); break; } }
-
+
}
if (recursive) { LOOP_OVER_BOTH (string prefix, mapping(mixed:DAVLock) sub_locks, { if (has_prefix(prefix, rsc)) { add_locks (sub_locks); } }); } add_locks = 0;