From: Arran Cudbard-Bell Date: Mon, 10 Oct 2011 22:17:37 +0000 (+0200) Subject: Need to check if the max_uses/lifetime/idle_timeout values > 0 (enabled) before enfor... X-Git-Tag: release_3_0_0_beta0~602 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a011b9e317e98f1239aa524dd8a0af0b2ca8670f;p=thirdparty%2Ffreeradius-server.git Need to check if the max_uses/lifetime/idle_timeout values > 0 (enabled) before enforcing them... --- diff --git a/src/main/connection.c b/src/main/connection.c index 020ca5ed7b0..b226dced7c5 100644 --- a/src/main/connection.c +++ b/src/main/connection.c @@ -285,16 +285,18 @@ static int fr_connection_manage(fr_connection_pool_t *fc, rad_assert(fc != NULL); rad_assert(this != NULL); - if (this->num_uses >= fc->max_uses) { + if ((fc->max_uses > 0) && (this->num_uses >= fc->max_uses)) { do_delete: fr_connection_close(fc, this); pthread_mutex_unlock(&fc->mutex); return 0; } - if ((this->start + fc->lifetime) < now) goto do_delete; + if ((fc->lifetime > 0) && ((this->start + fc->lifetime) < now)) + goto do_delete; - if ((this->last_used + fc->idle_timeout) < now) goto do_delete; + if ((fc->idle_timeout > 0) && ((this->last_used + fc->idle_timeout) < now)) + goto do_delete; return 1; }