dirmngr: Provide the keyserver pool name even if there is no CNAME.
authorWerner Koch <wk@gnupg.org>
Fri, 22 Jan 2016 11:34:50 +0000 (12:34 +0100)
committerWerner Koch <wk@gnupg.org>
Fri, 22 Jan 2016 11:34:50 +0000 (12:34 +0100)
* dirmngr/ks-engine-hkp.c (map_host): Fix setting of r_poolname.
--

map_host is intended to return the name of the pool as an additional
information.  However this broke some time ago and a pool name was
only retrained if the pool name was retrieved from a DNS CNAME.

Signed-off-by: Werner Koch <wk@gnupg.org>
dirmngr/ks-engine-hkp.c

index 598e614..eca02f0 100644 (file)
@@ -545,9 +545,9 @@ map_host (ctrl_t ctrl, const char *name, int force_reselect,
   if (hi->pool)
     {
       /* Deal with the pool name before selecting a host. */
-      if (r_poolname && hi->cname)
+      if (r_poolname)
         {
-          *r_poolname = xtrystrdup (hi->cname);
+          *r_poolname = xtrystrdup (hi->cname? hi->cname : hi->name);
           if (!*r_poolname)
             return gpg_error_from_syserror ();
         }