[Pkg-gnupg-commit] [gnupg2] 102/116: dirmngr: On SIGHUP mark all keyservers alive.

Daniel Kahn Gillmor dkg at fifthhorseman.net
Tue Jan 24 04:40:59 UTC 2017


This is an automated email from the git hooks/post-receive script.

dkg pushed a commit to branch master
in repository gnupg2.

commit 3ca3da8fc4ef802b8cceec5fde398a07b4888848
Author: Werner Koch <wk at gnupg.org>
Date:   Mon Jan 23 13:07:54 2017 +0100

    dirmngr: On SIGHUP mark all keyservers alive.
    
    * dirmngr/ks-engine-hkp.c (ks_hkp_reload): New.
    * dirmngr/dirmngr.c (dirmngr_sighup_action): Call it.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>
---
 dirmngr/dirmngr.c       |  1 +
 dirmngr/dirmngr.h       |  1 +
 dirmngr/ks-engine-hkp.c | 23 +++++++++++++++++++++++
 3 files changed, 25 insertions(+)

diff --git a/dirmngr/dirmngr.c b/dirmngr/dirmngr.c
index 92984b6..061cfc3 100644
--- a/dirmngr/dirmngr.c
+++ b/dirmngr/dirmngr.c
@@ -1702,6 +1702,7 @@ dirmngr_sighup_action (void)
   cert_cache_init ();
   crl_cache_init ();
   reload_dns_stuff (0);
+  ks_hkp_reload ();
 }
 
 
diff --git a/dirmngr/dirmngr.h b/dirmngr/dirmngr.h
index 9a87878..35bc000 100644
--- a/dirmngr/dirmngr.h
+++ b/dirmngr/dirmngr.h
@@ -194,6 +194,7 @@ const char* dirmngr_get_current_socket_name (void);
 
 /*-- Various housekeeping functions.  --*/
 void ks_hkp_housekeeping (time_t curtime);
+void ks_hkp_reload (void);
 
 
 /*-- server.c --*/
diff --git a/dirmngr/ks-engine-hkp.c b/dirmngr/ks-engine-hkp.c
index 08ef851..9de6267 100644
--- a/dirmngr/ks-engine-hkp.c
+++ b/dirmngr/ks-engine-hkp.c
@@ -1003,6 +1003,29 @@ ks_hkp_housekeeping (time_t curtime)
 }
 
 
+/* Reload (SIGHUP) action for this module.  We mark all host alive
+ * even those which have been manually shot.  */
+void
+ks_hkp_reload (void)
+{
+  int idx, count;
+  hostinfo_t hi;
+
+  for (idx=count=0; idx < hosttable_size; idx++)
+    {
+      hi = hosttable[idx];
+      if (!hi)
+        continue;
+      if (!hi->dead)
+        continue;
+      hi->dead = 0;
+      count++;
+    }
+  if (count)
+    log_info ("number of resurrected hosts: %d", count);
+}
+
+
 /* Send an HTTP request.  On success returns an estream object at
    R_FP.  HOSTPORTSTR is only used for diagnostics.  If HTTPHOST is
    not NULL it will be used as HTTP "Host" header.  If POST_CB is not

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gnupg2.git



More information about the Pkg-gnupg-commit mailing list