aboutsummaryrefslogtreecommitdiffstats
path: root/common/sysutils.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 /common/sysutils.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 'common/sysutils.c')
-rw-r--r--common/sysutils.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/common/sysutils.c b/common/sysutils.c
index a94d1fca5..648e70fe6 100644
--- a/common/sysutils.c
+++ b/common/sysutils.c
@@ -150,6 +150,17 @@ get_session_marker (size_t *rlen)
return marker;
}
+/* Return a random number in an unsigned int. */
+unsigned int
+get_uint_nonce (void)
+{
+ unsigned int value;
+
+ gcry_create_nonce (&value, sizeof value);
+ return value;
+}
+
+
#if 0 /* not yet needed - Note that this will require inclusion of
cmacros.am in Makefile.am */