Skip to content

[2.4.x] mod_dav_fs: add DAVLockDBType and add global mutex around lockdb use - #399

Open
notroj wants to merge 4 commits into
apache:2.4.xfrom
notroj:24x-dav-fs-lockdb
Open

[2.4.x] mod_dav_fs: add DAVLockDBType and add global mutex around lockdb use#399
notroj wants to merge 4 commits into
apache:2.4.xfrom
notroj:24x-dav-fs-lockdb

Conversation

@notroj

@notroj notroj commented Dec 8, 2023

Copy link
Copy Markdown
Collaborator

No description provided.

@notroj
notroj force-pushed the 24x-dav-fs-lockdb branch from abf2002 to 1e2e2ec Compare August 26, 2026 13:21
@notroj notroj changed the title 2.4 mod_dav_fs: add DAVLockDBType and add global mutex around lockdb use [2.4.x] mod_dav_fs: add DAVLockDBType and add global mutex around lockdb use Aug 26, 2026
notroj and others added 4 commits August 27, 2026 20:30
  APR_MAJOR_VERSION, APU_MAJOR_VERSION is not defined for APR trunk
  since the #include <apu_version.h> is conditional on APR < 2.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1912571 13f79535-47bb-0310-9956-ffa450edef68
(cherry picked from commit fb0ac6a)
* modules/dav/fs/dbm.c (dav_dbm_open_direct): Take a dbmtype argument
  and use it to select the apr_dbm driver type.
  (dav_dbm_open): Continue to use the "default" propdb type to open
  the property databases.

* modules/dav/fs/lock.c: Store and pass through the lockdb_type
  through.

* modules/dav/fs/mod_dav_fs.c (dav_get_lockdb_path): Return the dbm
  type via an output argument.
  (dav_fs_cmd_davlockdbtype): New config directive.
  (dav_fs_merge_server_config): Merge the dbm type.
  (dav_fs_post_config): Set the default lockdb type.

* modules/dav/fs/repos.h: Update prototypes as above; internal API
  only so no compat concerns.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1912718 13f79535-47bb-0310-9956-ffa450edef68
(cherry picked from commit afcdbee)
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.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1914438 13f79535-47bb-0310-9956-ffa450edef68
(cherry picked from commit 455147a)
@notroj
notroj force-pushed the 24x-dav-fs-lockdb branch from 1e2e2ec to 0ce4650 Compare August 27, 2026 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant