summaryrefslogtreecommitdiff
path: root/radsecproxy.c
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordu.net>2016-10-20 11:50:55 +0200
committerLinus Nordberg <linus@nordu.net>2016-11-01 10:36:48 +0100
commit3b3742a9f5fb087674bd448636c06f011f81e8d7 (patch)
treea91757eeb6127ad2e779ab31dc105d25b061639c /radsecproxy.c
parenta44e795d6cb39edb422afb99841dfe7e242f6bb7 (diff)
Remove --enable-experimental-dyndisc build config knob.
Be aware that use of the DynamicLookupCommand configuration option still enables code known to be buggy.
Diffstat (limited to 'radsecproxy.c')
-rw-r--r--radsecproxy.c39
1 files changed, 1 insertions, 38 deletions
diff --git a/radsecproxy.c b/radsecproxy.c
index a4d8c07..7efebed 100644
--- a/radsecproxy.c
+++ b/radsecproxy.c
@@ -1,5 +1,5 @@
/* Copyright (c) 2007-2009, UNINETT AS
- * Copyright (c) 2010-2013,2015 NORDUnet A/S */
+ * Copyright (c) 2010-2013,2015-2016, NORDUnet A/S */
/* See LICENSE for licensing information. */
/* For UDP there is one server instance consisting of udpserverrd and udpserverth
@@ -301,10 +301,6 @@ void freeserver(struct server *server, uint8_t destroymutex) {
freebios(server->rbios);
free(server->dynamiclookuparg);
if (server->ssl) {
-#if defined ENABLE_EXPERIMENTAL_DYNDISC
- if (server->sock >= 0)
- close(server->sock);
-#endif
SSL_free(server->ssl);
}
if (destroymutex) {
@@ -710,12 +706,7 @@ int hasdynamicserver(struct list *srvconfs) {
struct list_node *entry;
for (entry = list_first(srvconfs); entry; entry = list_next(entry))
-#if defined ENABLE_EXPERIMENTAL_DYNDISC
- if (((struct clsrvconf *)entry->data)->dynamiclookupcommand
- || ((struct clsrvconf *)entry->data)->servers->in_use)
-#else
if (((struct clsrvconf *)entry->data)->dynamiclookupcommand)
-#endif
return 1;
return 0;
}
@@ -1766,17 +1757,11 @@ void *clientwr(void *arg) {
dynconffail = 1;
server->dynstartup = 0;
server->dynfailing = 1;
-#if defined ENABLE_EXPERIMENTAL_DYNDISC
- pthread_mutex_unlock(&server->lock);
-#endif
debug(DBG_WARN, "%s: dynamicconfig(%s: %s) failed, sleeping %ds",
__func__, server->conf->name, server->dynamiclookuparg, ZZZ);
sleep(ZZZ);
goto errexit;
}
-#if defined ENABLE_EXPERIMENTAL_DYNDISC
- pthread_mutex_unlock(&server->lock);
-#endif
/* FIXME: Is resolving not always done by compileserverconfig(),
* either as part of static configuration setup or by
* dynamicconfig() above? */
@@ -1805,9 +1790,6 @@ void *clientwr(void *arg) {
goto errexit;
}
server->connectionok = 1;
-#if defined ENABLE_EXPERIMENTAL_DYNDISC
- server->in_use = 1;
-#endif
if (pthread_create(&clientrdth, &pthread_attr, conf->pdef->clientconnreader, (void *)server)) {
debugerrno(errno, DBG_ERR, "clientwr: pthread_create failed");
goto errexit;
@@ -1917,9 +1899,6 @@ void *clientwr(void *arg) {
}
}
errexit:
-#if defined ENABLE_EXPERIMENTAL_DYNDISC
- server->in_use = 0;
-#endif
conf->servers = NULL;
if (server->dynamiclookuparg) {
removeserversubrealms(realms, conf);
@@ -2203,29 +2182,13 @@ struct list *createsubrealmservers(struct realm *realm, struct list *srvconfs) {
srvconf->servers->dynstartup = 1;
debug(DBG_DBG, "%s: new client writer for %s",
__func__, srvconf->servers->conf->name);
-#if defined ENABLE_EXPERIMENTAL_DYNDISC
- pthread_mutex_lock(&srvconf->servers->lock);
-#endif
if (pthread_create(&clientth, &pthread_attr, clientwr, (void *)(srvconf->servers))) {
-#if defined ENABLE_EXPERIMENTAL_DYNDISC
- pthread_mutex_unlock(&srvconf->servers->lock);
-#endif
debugerrno(errno, DBG_ERR, "pthread_create failed");
freeserver(srvconf->servers, 1);
srvconf->servers = NULL;
-#if defined ENABLE_EXPERIMENTAL_DYNDISC
- conf = srvconf;
- continue;
-#endif
} else
pthread_detach(clientth);
-#if defined ENABLE_EXPERIMENTAL_DYNDISC
- /* If clientwr() could not find a NAPTR we have to
- * wait for dynfailing=1 what is set in clientwr(). */
- pthread_mutex_lock(&srvconf->servers->lock);
- pthread_mutex_unlock(&srvconf->servers->lock);
-#endif
}
conf = srvconf;
}