mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
gpg: Avoid multiple open calls to the keybox file.
* g10/keydb.h (KEYDB_HANDLE): Move typedef to ... * g10/gpg.h: here. (struct server_control_s): Add field 'cached_getkey_kdb'. * g10/gpg.c (gpg_deinit_default_ctrl): Release that keydb handle. * g10/getkey.c (getkey_end): Cache keydb handle. (get_pubkey): Use cached keydb handle. * kbx/keybox-search.c (keybox_search_reset): Use lseek instead of closing the file. -- Before this patch a "gpg --check-sigs" opened and closed the keybox file for almost every signature check. By caching the keydb handle and using lseek(2) this can be limited to just 2 times. This might speed up things on Windows. Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
aca5f494a8
commit
5556eca5ac
5 changed files with 33 additions and 11 deletions
|
@ -2195,6 +2195,8 @@ gpg_deinit_default_ctrl (ctrl_t ctrl)
|
|||
tofu_closedbs (ctrl);
|
||||
#endif
|
||||
gpg_dirmngr_deinit_session_data (ctrl);
|
||||
|
||||
keydb_release (ctrl->cached_getkey_kdb);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue