summaryrefslogtreecommitdiff
path: root/radsecproxy.c
diff options
context:
space:
mode:
authorvenaas <venaas>2008-09-30 14:40:17 +0000
committervenaas <venaas@e88ac4ed-0b26-0410-9574-a7f39faa03bf>2008-09-30 14:40:17 +0000
commitce2faa29b9e921d11e93b54a98dee687d4a861b4 (patch)
tree9e965c605fcdd4cf993c40b5a77cf7840d8f473f /radsecproxy.c
parent9059151dbb4dbda7f7d4f1a96a7d0b8db5756a0a (diff)
expiry of udp clients
git-svn-id: https://svn.testnett.uninett.no/radsecproxy/trunk@412 e88ac4ed-0b26-0410-9574-a7f39faa03bf
Diffstat (limited to 'radsecproxy.c')
-rw-r--r--radsecproxy.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/radsecproxy.c b/radsecproxy.c
index 533bf90..b89577a 100644
--- a/radsecproxy.c
+++ b/radsecproxy.c
@@ -36,7 +36,6 @@
/* Bugs:
* May segfault when dtls connections go down? More testing needed
- * Need to remove UDP clients when no activity for a while...
* Remove expired stuff from clients request list?
* Multiple outgoing connections if not enough IDs? (multiple servers per conf?)
* Useful for TCP accounting? Now we require separate server config for alt port
@@ -574,13 +573,10 @@ void removeclientrqs(struct client *client) {
removeclientrqs_sendrq_freeserver_lock(0);
}
-void removeclient(struct client *client) {
+void removelockedclient(struct client *client) {
struct clsrvconf *conf;
- if (!client)
- return;
conf = client->conf;
- pthread_mutex_lock(conf->lock);
if (conf->clients) {
removeclientrqs(client);
removequeue(client->replyq);
@@ -588,6 +584,17 @@ void removeclient(struct client *client) {
free(client->addr);
free(client);
}
+}
+
+void removeclient(struct client *client) {
+ struct clsrvconf *conf;
+
+ if (!client)
+ return;
+
+ conf = client->conf;
+ pthread_mutex_lock(conf->lock);
+ removelockedclient(client);
pthread_mutex_unlock(conf->lock);
}
@@ -2037,7 +2044,7 @@ void replyh(struct server *server, unsigned char *buf) {
goto errunlock;
}
- debug(DBG_INFO, "replyh: passing reply to client %s", from->conf->name);
+ debug(DBG_INFO, "replyh: passing reply to client %s (%s)", from->conf->name, addr2string(from->addr));
radmsg_free(rqout->rq->msg);
rqout->rq->msg = msg;
sendreply(newrqref(rqout->rq));