mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
gpg: Print a warning on Tor problems.
* dirmngr/ks-engine-hkp.c (tor_not_running_p): New. (map_host): Call that to print a warning. (handle_send_request_error): Ditto and avoid marking the host dead. Also print a tor_config_problem warning. Add arg CTRL; adjust callers to pass that new arg. * g10/call-dirmngr.c (ks_status_cb): Detect and print the new warnings. Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
51e5a5e5a4
commit
770b75a746
2 changed files with 70 additions and 16 deletions
|
@ -374,7 +374,8 @@ ks_status_cb (void *opaque, const char *line)
|
|||
{
|
||||
struct ks_status_parm_s *parm = opaque;
|
||||
gpg_error_t err = 0;
|
||||
const char *s;
|
||||
const char *s, *s2;
|
||||
const char *warn;
|
||||
|
||||
if ((s = has_leading_keyword (line, parm->keyword? parm->keyword : "SOURCE")))
|
||||
{
|
||||
|
@ -385,6 +386,29 @@ ks_status_cb (void *opaque, const char *line)
|
|||
err = gpg_error_from_syserror ();
|
||||
}
|
||||
}
|
||||
else if ((s = has_leading_keyword (line, "WARNING")))
|
||||
{
|
||||
if ((s2 = has_leading_keyword (s, "tor_not_running")))
|
||||
warn = _("Tor is not running");
|
||||
else if ((s2 = has_leading_keyword (s, "tor_config_problem")))
|
||||
warn = _("Tor is not properly configured");
|
||||
else
|
||||
warn = NULL;
|
||||
|
||||
if (warn)
|
||||
{
|
||||
log_info (_("WARNING: %s\n"), warn);
|
||||
if (s2)
|
||||
{
|
||||
while (*s2 && !spacep (s2))
|
||||
s2++;
|
||||
while (*s2 && spacep (s2))
|
||||
s2++;
|
||||
if (*s2)
|
||||
print_further_info ("%s", s2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue