From 19b5ce7ac3f838e689ae6e6b1e4a0c114b44ce67 Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Wed, 25 Apr 2012 17:41:27 +0200 Subject: Postpone resolving of DNS names of server. We used to resolve DNS names when reading configuration. We now do it in event_init_socket() and cache the result in the connection object. The imminent need for changing this is to keep host names around for X509 certificate verification (CNAME and subjectAltName). This will also help later when we implement server failover (and later, when people want to do more dynamic configuration, f.ex. NAPTR). --- lib/conf.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'lib/conf.c') diff --git a/lib/conf.c b/lib/conf.c index 71bd169..ad1a5f8 100644 --- a/lib/conf.c +++ b/lib/conf.c @@ -226,10 +226,8 @@ rs_context_read_config(struct rs_context *ctx, const char *config_file) p->realm = r; cfg_server = cfg_getnsec (cfg_realm, "server", j); - /* FIXME: Handle resolve errors, possibly by postponing name - resolution. */ - rs_resolv (&p->addr, r->type, cfg_getstr (cfg_server, "hostname"), - cfg_getstr (cfg_server, "service")); + p->hostname = cfg_getstr (cfg_server, "hostname"); + p->service = cfg_getstr (cfg_server, "service"); p->secret = cfg_getstr (cfg_server, "secret"); } } -- cgit v1.1