summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvenaas <venaas>2008-06-10 08:51:19 +0000
committervenaas <venaas@e88ac4ed-0b26-0410-9574-a7f39faa03bf>2008-06-10 08:51:19 +0000
commit423f967a41c0e05355594895223578c3fe69baab (patch)
tree2cb19ec5ae3a594b43b1ea069d241b1468fc97ed
parent4f7738e4fb6b55819fdbe531aeafa73fb7d9b38b (diff)
failover also when not using status server
git-svn-id: https://svn.testnett.uninett.no/radsecproxy/trunk@287 e88ac4ed-0b26-0410-9574-a7f39faa03bf
-rw-r--r--radsecproxy.c14
-rw-r--r--radsecproxy.h2
2 files changed, 7 insertions, 9 deletions
diff --git a/radsecproxy.c b/radsecproxy.c
index b3ccfd0..6100bb1 100644
--- a/radsecproxy.c
+++ b/radsecproxy.c
@@ -1930,13 +1930,13 @@ struct clsrvconf *choosesrvconf(struct list *srvconfs) {
first = server;
if (!server->servers->connectionok)
continue;
- if (!server->servers->loststatsrv)
+ if (!server->servers->lostrqs)
return server;
if (!best) {
best = server;
continue;
}
- if (server->servers->loststatsrv < best->servers->loststatsrv)
+ if (server->servers->lostrqs < best->servers->lostrqs)
best = server;
}
return best ? best : first;
@@ -2095,7 +2095,7 @@ int replyh(struct server *server, unsigned char *buf) {
char tmp[760], stationid[760];
server->connectionok = 1;
- server->loststatsrv = 0;
+ server->lostrqs = 0;
i = buf[1]; /* i is the id */
@@ -2400,11 +2400,9 @@ void *clientwr(void *arg) {
if (rq->tries == (*rq->buf == RAD_Status_Server || server->conf->type == 'T'
? 1 : REQUEST_RETRIES)) {
debug(DBG_DBG, "clientwr: removing expired packet from queue");
- if (*rq->buf == RAD_Status_Server) {
- debug(DBG_WARN, "clientwr: no status server response, %s dead?", conf->host);
- if (server->loststatsrv < 255)
- server->loststatsrv++;
- }
+ debug(DBG_WARN, "clientwr: no server response, %s dead?", conf->host);
+ if (server->lostrqs < 255)
+ server->lostrqs++;
freerqdata(rq);
/* setting this to NULL means that it can be reused */
rq->buf = NULL;
diff --git a/radsecproxy.h b/radsecproxy.h
index fb4d30d..bd74f75 100644
--- a/radsecproxy.h
+++ b/radsecproxy.h
@@ -116,7 +116,7 @@ struct server {
uint8_t clientrdgone;
struct timeval lastconnecttry;
uint8_t connectionok;
- uint8_t loststatsrv;
+ uint8_t lostrqs;
char *dynamiclookuparg;
int nextid;
struct request *requests;