aboutsummaryrefslogtreecommitdiffstats
path: root/dirmngr/server.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2022-02-01 15:02:20 +0000
committerWerner Koch <[email protected]>2022-02-01 15:03:06 +0000
commit57d546674d081b9a4cd5d9281ea34cb5c85d2830 (patch)
treec6f7bb7e8f75a9e5be29d293e2b9faf9a5f7a882 /dirmngr/server.c
parentsm: Partly revert last commit. (diff)
downloadgnupg-57d546674d081b9a4cd5d9281ea34cb5c85d2830.tar.gz
gnupg-57d546674d081b9a4cd5d9281ea34cb5c85d2830.zip
dirmngr: Avoid initial delay on the first keyserver access.
* dirmngr/dirmngr.c (dirmngr_never_use_tor_p): New. * dirmngr/server.c (ensure_keyserver): Don't even test for the Tor proxy in never-use-tor Mode. * tools/gpgtar-create.c: Include unistd.h to avoid a warning on Windows. -- This delay of 2 or 3 seconds is in particular annoying on Windows. This is now suppressed, as it should be, if --no-use-tor is used. The second patch is unrelated
Diffstat (limited to 'dirmngr/server.c')
-rw-r--r--dirmngr/server.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/dirmngr/server.c b/dirmngr/server.c
index 65bc50fb4..c65e0633e 100644
--- a/dirmngr/server.c
+++ b/dirmngr/server.c
@@ -2276,7 +2276,7 @@ ensure_keyserver (ctrl_t ctrl)
{
/* If there is just one onion and one plain keyserver given, we take
only one depending on whether Tor is running or not. */
- if (is_tor_running (ctrl))
+ if (!dirmngr_never_use_tor_p () && is_tor_running (ctrl))
{
ctrl->server_local->keyservers = onion_items;
onion_items = NULL;
@@ -2287,7 +2287,7 @@ ensure_keyserver (ctrl_t ctrl)
plain_items = NULL;
}
}
- else if (!is_tor_running (ctrl))
+ else if (dirmngr_never_use_tor_p () || !is_tor_running (ctrl))
{
/* Tor is not running. It does not make sense to add Onion
addresses. */