core: speedup gpgme_get_key

* src/engine.c (_gpgme_set_engine_info): Change engine_get_version.
--

GnuPG-bug-id: 6369
This commit is contained in:
Werner Koch 2024-05-21 10:59:43 +02:00
parent 0f5e8182e7
commit 73403a8ba0
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B
3 changed files with 11 additions and 4 deletions

2
NEWS
View File

@ -1,4 +1,4 @@
Noteworthy changes in version 1.23.3 (unrelease) Noteworthy changes in version 1.24.0 (unrelease)
------------------------------------------------- -------------------------------------------------
* Extended gpgme_op_decrypt* and gpgme_op_verify* to allow writing the * Extended gpgme_op_decrypt* and gpgme_op_verify* to allow writing the

View File

@ -31,8 +31,8 @@ min_automake_version="1.14"
# for the LT versions. # for the LT versions.
m4_define([mym4_package],[gpgme]) m4_define([mym4_package],[gpgme])
m4_define([mym4_major], [1]) m4_define([mym4_major], [1])
m4_define([mym4_minor], [23]) m4_define([mym4_minor], [24])
m4_define([mym4_micro], [3]) m4_define([mym4_micro], [0])
# Below is m4 magic to extract and compute the git revision number, # Below is m4 magic to extract and compute the git revision number,
# the decimalized short revision number, a beta version string and a # the decimalized short revision number, a beta version string and a

View File

@ -449,9 +449,16 @@ _gpgme_set_engine_info (gpgme_engine_info_t info, gpgme_protocol_t proto,
new_home_dir = NULL; new_home_dir = NULL;
} }
if (info && info->version
&& ((!info->file_name && !new_file_name)
|| (info->file_name && new_file_name
&& !strcmp (info->file_name, new_file_name))))
new_version = strdup (info->version);
else
new_version = engine_get_version (proto, new_file_name); new_version = engine_get_version (proto, new_file_name);
if (!new_version) if (!new_version)
{ {
/* Note that we also get here on a ENOMEM in strdup. */
new_version = strdup ("1.0.0"); /* Fake one for dummy entries. */ new_version = strdup ("1.0.0"); /* Fake one for dummy entries. */
if (!new_version) if (!new_version)
{ {