MCPcopy Create free account
hub / github.com/apache/httpd / dav_lock_walker

Function dav_lock_walker

modules/dav/main/util_lock.c:260–289  ·  view source on GitHub ↗

dav_lock_walker: Walker callback function to record indirect locks */

Source from the content-addressed store, hash-verified

258
259/* dav_lock_walker: Walker callback function to record indirect locks */
260static dav_error * dav_lock_walker(dav_walk_resource *wres, int calltype)
261{
262 dav_walker_ctx *ctx = wres->walk_ctx;
263 dav_error *err;
264
265 /* We don't want to set indirects on the target */
266 if ((*wres->resource->hooks->is_same_resource)(wres->resource,
267 ctx->w.root))
268 return NULL;
269
270 if ((err = (*ctx->w.lockdb->hooks->append_locks)(ctx->w.lockdb,
271 wres->resource, 1,
272 ctx->lock)) != NULL) {
273 if (ap_is_HTTP_SERVER_ERROR(err->status)) {
274 /* ### add a higher-level description? */
275 return err;
276 }
277
278 /* add to the multistatus response */
279 dav_add_response(wres, err->status, NULL);
280
281 /*
282 ** ### actually, this is probably wrong: we want to fail the whole
283 ** ### LOCK process if something goes bad. maybe the caller should
284 ** ### do a dav_unlock() (e.g. a rollback) if any errors occurred.
285 */
286 }
287
288 return NULL;
289}
290
291/*
292** dav_add_lock: Add a direct lock for resource, and indirect locks for

Callers

nothing calls this directly

Calls 1

dav_add_responseFunction · 0.85

Tested by

no test coverage detected