mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
dirmngr: Change internal SRV lookup API.
* dirmngr/dns-stuff.c (get_dns_srv): Add args SERVICE and PROTO. * dirmngr/http.c (connect_server): Simplify SRV lookup. * dirmngr/ks-engine-hkp.c (map_host): Ditto. * dirmngr/t-dns-stuff.c (main): Adjust for changed get_dns_srv. -- This new API is more convenient because it includes commonly used code. Note that right now http.c's SRV record code is not used. Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
9fa94aa107
commit
16078f3dee
5 changed files with 31 additions and 37 deletions
|
@ -426,7 +426,6 @@ map_host (ctrl_t ctrl, const char *name, int force_reselect,
|
|||
int refidx;
|
||||
int is_pool = 0;
|
||||
char *cname;
|
||||
char *srvrecord;
|
||||
struct srventry *srvs;
|
||||
unsigned int srvscount;
|
||||
|
||||
|
@ -448,16 +447,7 @@ map_host (ctrl_t ctrl, const char *name, int force_reselect,
|
|||
if (!is_ip_address (name))
|
||||
{
|
||||
/* Check for SRV records. */
|
||||
srvrecord = xtryasprintf ("_hkp._tcp.%s", name);
|
||||
if (srvrecord == NULL)
|
||||
{
|
||||
err = gpg_error_from_syserror ();
|
||||
xfree (reftbl);
|
||||
return err;
|
||||
}
|
||||
|
||||
err = get_dns_srv (srvrecord, &srvs, &srvscount);
|
||||
xfree (srvrecord);
|
||||
err = get_dns_srv (name, "hkp", NULL, &srvs, &srvscount);
|
||||
if (err)
|
||||
{
|
||||
xfree (reftbl);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue