summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvenaas <venaas>2008-04-14 10:56:08 +0000
committervenaas <venaas@e88ac4ed-0b26-0410-9574-a7f39faa03bf>2008-04-14 10:56:08 +0000
commitded9f1a896f55b801bf95e7764f122ec4e51edcf (patch)
tree5608d0cfb7375f0c4f5c862c555d6ef226fd6501
parent4f752075776c58c49447e2826b37675afc67ee07 (diff)
moved null client check to after status server
git-svn-id: https://svn.testnett.uninett.no/radsecproxy/trunk@227 e88ac4ed-0b26-0410-9574-a7f39faa03bf
-rw-r--r--radsecproxy.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/radsecproxy.c b/radsecproxy.c
index 8b7906c..9bf050b 100644
--- a/radsecproxy.c
+++ b/radsecproxy.c
@@ -1852,8 +1852,7 @@ int replyh(struct server *server, unsigned char *buf) {
}
rq = server->requests + i;
- from = rq->from;
-
+
pthread_mutex_lock(&server->newrq_mutex);
if (!rq->buf || !rq->tries) {
pthread_mutex_unlock(&server->newrq_mutex);
@@ -1861,12 +1860,6 @@ int replyh(struct server *server, unsigned char *buf) {
return 0;
}
- if (!from) {
- pthread_mutex_unlock(&server->newrq_mutex);
- debug(DBG_INFO, "replyh: client gone, ignoring reply");
- return 0;
- }
-
if (rq->received) {
pthread_mutex_unlock(&server->newrq_mutex);
debug(DBG_INFO, "replyh: already received, ignoring reply");
@@ -1914,6 +1907,13 @@ int replyh(struct server *server, unsigned char *buf) {
return 0;
}
+ from = rq->from;
+ if (!from) {
+ pthread_mutex_unlock(&server->newrq_mutex);
+ debug(DBG_INFO, "replyh: client gone, ignoring reply");
+ return 0;
+ }
+
if (server->conf->rewrite) {
dorewrite(buf, server->conf->rewrite);
len = RADLEN(buf) - 20;