From aeb7a66bfcb5ac292c4c22b7157c5b05ba4dbba8 Mon Sep 17 00:00:00 2001 From: venaas Date: Mon, 14 Apr 2008 10:56:08 +0000 Subject: moved null client check to after status server git-svn-id: https://svn.testnett.uninett.no/radsecproxy/branches/release-1.1@227 e88ac4ed-0b26-0410-9574-a7f39faa03bf --- radsecproxy.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'radsecproxy.c') diff --git a/radsecproxy.c b/radsecproxy.c index 1178273..705b83c 100644 --- a/radsecproxy.c +++ b/radsecproxy.c @@ -1830,7 +1830,6 @@ 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) { @@ -1839,12 +1838,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"); @@ -1892,6 +1885,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; -- cgit v1.1