diff options
author | venaas <venaas> | 2008-12-18 15:14:00 +0000 |
---|---|---|
committer | venaas <venaas@e88ac4ed-0b26-0410-9574-a7f39faa03bf> | 2008-12-18 15:14:00 +0000 |
commit | 3c779c1093a5cb6314bc366c6135fb2eaac8cdeb (patch) | |
tree | 0ba9c4f9ebdb9a91bee68c286abc9c1e6b66a286 /tls.c | |
parent | dfb9fcfbba3e196b4c082cc9b8a1fe7b80ac8564 (diff) |
cleaning up code
git-svn-id: https://svn.testnett.uninett.no/radsecproxy/trunk@441 e88ac4ed-0b26-0410-9574-a7f39faa03bf
Diffstat (limited to 'tls.c')
-rw-r--r-- | tls.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -32,6 +32,13 @@ #include "radsecproxy.h" #include "tls.h" +static struct addrinfo *srcres = NULL; + +void tlssetsrcres(char *source) { + if (!srcres) + srcres = resolve_hostport_addrinfo(RAD_TLS, source); +} + int tlsconnect(struct server *server, struct timeval *when, int timeout, char *text) { struct timeval now; time_t elapsed; @@ -76,7 +83,7 @@ int tlsconnect(struct server *server, struct timeval *when, int timeout, char *t debug(DBG_WARN, "tlsconnect: trying to open TLS connection to %s port %s", server->conf->host, server->conf->port); if (server->sock >= 0) close(server->sock); - if ((server->sock = connecttcp(server->conf->addrinfo, getsrcprotores(RAD_TLS))) < 0) { + if ((server->sock = connecttcp(server->conf->addrinfo, srcres)) < 0) { debug(DBG_ERR, "tlsconnect: connecttcp failed"); continue; } |