]> git.ipfire.org Git - thirdparty/apache/httpd.git/commit
mod_dav_fs: Add global mutex around use of lockdb use, since
authorJoe Orton <jorton@apache.org>
Thu, 7 Dec 2023 18:25:35 +0000 (18:25 +0000)
committerJoe Orton <jorton@apache.org>
Thu, 7 Dec 2023 18:25:35 +0000 (18:25 +0000)
commit455147a36049efc443921ea523d01aa62e047fa3
treeb804502d052e509a1ea36c5861d383db264ad503
parentbd3bc707303a27bc87a6acba33ebdd518b956b3d
mod_dav_fs: Add global mutex around use of lockdb use, since
apr_dbm does not provide thread-safe locking:

* modules/dav/fs/mod_dav_fs.c (dav_fs_get_server_conf):
  Replaces dav_get_lockdb_path.
  (dav_fs_pre_config, dav_fs_child_init): New hooks.
  (dav_fs_post_config): Create & store the mutex here.
  (register_hooks): Register new hooks.

* modules/dav/fs/repos.h: Expose new dav_fs_server_conf struct.

* modules/dav/fs/lock.c (dav_fs_lockdb_cleanup): New cleanup
  which unlocks and closes the dbm handle.
  (dav_fs_really_open_lockdb): Lock the mutex here, register a
  cleanup.
  (dav_fs_open_lockdb): Adjust to use dav_fs_get_server_conf.
  (dav_fs_close_lockdb): Run the cleanup here.

Github: closes #395

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1914438 13f79535-47bb-0310-9956-ffa450edef68
modules/dav/fs/lock.c
modules/dav/fs/mod_dav_fs.c
modules/dav/fs/repos.h