mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-31 11:41:32 +01:00
dirmngr: Cleanup of the no-Tor check with --gpgconf-* commands
* dirmngr/dirmngr.c (post_option_parsing): Add arg CMD. (main): Pass the current command. -- Updates-commit: 9f37e93dd741a5436ff412955628806ae84725ca
This commit is contained in:
parent
d1298fa287
commit
b58cf129f4
@ -886,7 +886,7 @@ parse_rereadable_options (gpgrt_argparse_t *pargs, int reread)
|
||||
/* This function is called after option parsing to adjust some values
|
||||
* and call option setup functions. */
|
||||
static void
|
||||
post_option_parsing (void)
|
||||
post_option_parsing (enum cmd_and_opt_values cmd)
|
||||
{
|
||||
/* It would be too surpirsing if the quick timeout is larger than
|
||||
* the standard value. */
|
||||
@ -894,6 +894,18 @@ post_option_parsing (void)
|
||||
opt.connect_quick_timeout = opt.connect_timeout;
|
||||
|
||||
set_debug ();
|
||||
/* For certain commands we do not want to set/test for Tor mode
|
||||
* because that is somewhat expensive. */
|
||||
switch (cmd)
|
||||
{
|
||||
case aGPGConfList:
|
||||
case aGPGConfTest:
|
||||
case aGPGConfVersions:
|
||||
break;
|
||||
default:
|
||||
set_tor_mode ();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1214,12 +1226,7 @@ main (int argc, char **argv)
|
||||
log_printf ("\n");
|
||||
}
|
||||
|
||||
/* Note that we do not run set_tor_mode in --gpgconf-list mode
|
||||
* because it will attempt to connect to the tor client and that can
|
||||
* be time consuming. */
|
||||
post_option_parsing ();
|
||||
if (cmd != aGPGConfTest && cmd != aGPGConfList && cmd != aGPGConfVersions)
|
||||
set_tor_mode ();
|
||||
post_option_parsing (cmd);
|
||||
|
||||
/* Get LDAP server list from file unless --ldapserver has been used. */
|
||||
#if USE_LDAP
|
||||
@ -1965,7 +1972,7 @@ reread_configuration (void)
|
||||
}
|
||||
gpgrt_argparse (NULL, &pargs, NULL); /* Release internal state. */
|
||||
xfree (twopart);
|
||||
post_option_parsing ();
|
||||
post_option_parsing (0);
|
||||
|
||||
finish:
|
||||
/* Get a default log file from common.conf. */
|
||||
|
Loading…
x
Reference in New Issue
Block a user