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

Function dav_fs_open_lockdb

modules/dav/fs/lock.c:333–363  ·  view source on GitHub ↗

** dav_fs_open_lockdb: ** ** "open" the lock database, as specified in the global server configuration. ** If force is TRUE, then the database is opened now, rather than lazily. ** ** Note that only one can be open read/write. */

Source from the content-addressed store, hash-verified

331** Note that only one can be open read/write.
332*/
333static dav_error * dav_fs_open_lockdb(request_rec *r, int ro, int force,
334 dav_lockdb **lockdb)
335{
336 dav_lockdb_combined *comb;
337
338 comb = apr_pcalloc(r->pool, sizeof(*comb));
339 comb->pub.hooks = &dav_hooks_locks_fs;
340 comb->pub.ro = ro;
341 comb->pub.info = &comb->priv;
342 comb->priv.r = r;
343 comb->priv.pool = r->pool;
344
345 comb->priv.lockdb_path = dav_get_lockdb_path(r);
346 if (comb->priv.lockdb_path == NULL) {
347 return dav_new_error(r->pool, HTTP_INTERNAL_SERVER_ERROR,
348 DAV_ERR_LOCK_NO_DB, 0,
349 "A lock database was not specified with the "
350 "DAVLockDB directive. One must be specified "
351 "to use the locking functionality.");
352 }
353
354 /* done initializing. return it. */
355 *lockdb = &comb->pub;
356
357 if (force) {
358 /* ### add a higher-level comment? */
359 return dav_fs_really_open_lockdb(*lockdb);
360 }
361
362 return NULL;
363}
364
365/*
366** dav_fs_close_lockdb:

Callers

nothing calls this directly

Calls 3

dav_get_lockdb_pathFunction · 0.85
dav_new_errorFunction · 0.85

Tested by

no test coverage detected