Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.4 mod_dav_fs: add DAVLockDBType and add global mutex around lockdb use #399

Open
wants to merge 5 commits into
base: 2.4.x
Choose a base branch
from

Conversation

notroj
Copy link
Collaborator

@notroj notroj commented Dec 8, 2023

No description provided.

notroj and others added 5 commits December 8, 2023 11:22
  error message references to "property" databases since these
  functions are used for both propdbs and the lock database.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1912477 13f79535-47bb-0310-9956-ffa450edef68
(cherry picked from commit c6d7943)
  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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant