aboutsummaryrefslogtreecommitdiffstats
path: root/dirmngr/server.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2011-04-12 14:30:08 +0000
committerWerner Koch <[email protected]>2011-04-12 14:30:08 +0000
commitf1e9f510ec70f2bb64f1b61b2b040d8d3103af32 (patch)
tree308c29c8de56f5bac9e711466ba1ce9a89fc1439 /dirmngr/server.c
parentDetect premature EOF while parsing corrupted key packets. (diff)
downloadgnupg-f1e9f510ec70f2bb64f1b61b2b040d8d3103af32.tar.gz
gnupg-f1e9f510ec70f2bb64f1b61b2b040d8d3103af32.zip
Add code for explicit selection of pooled A records.
To better cope with round robin pooled A records like keys.gnupg.net we need to keep some information on unresponsive hosts etc. What we do now is to resolve the hostnames, remember them and select a random one. If a host is dead it will be marked and a different one selected. This is intended to solve the problem of long timeouts due to unresponsive hosts. The code is not yet finished but selection works.
Diffstat (limited to 'dirmngr/server.c')
-rw-r--r--dirmngr/server.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/dirmngr/server.c b/dirmngr/server.c
index 1a244c896..76d36c132 100644
--- a/dirmngr/server.c
+++ b/dirmngr/server.c
@@ -42,6 +42,7 @@
#include "misc.h"
#include "ldap-wrapper.h"
#include "ks-action.h"
+#include "ks-engine.h" /* (ks_hkp_print_hosttable) */
/* To avoid DoS attacks we limit the size of a certificate to
something reasonable. */
@@ -1374,12 +1375,13 @@ cmd_keyserver (assuan_context_t ctx, char *line)
{
ctrl_t ctrl = assuan_get_pointer (ctx);
gpg_error_t err;
- int clear_flag, add_flag, help_flag;
+ int clear_flag, add_flag, help_flag, host_flag;
uri_item_t item = NULL; /* gcc 4.4.5 is not able to detect that it
is always initialized. */
clear_flag = has_option (line, "--clear");
help_flag = has_option (line, "--help");
+ host_flag = has_option (line, "--print-hosttable");
line = skip_options (line);
add_flag = !!*line;
@@ -1389,6 +1391,13 @@ cmd_keyserver (assuan_context_t ctx, char *line)
goto leave;
}
+ if (host_flag)
+ {
+ ks_hkp_print_hosttable ();
+ err = 0;
+ goto leave;
+ }
+
if (add_flag)
{
item = xtrymalloc (sizeof *item + strlen (line));