From: Arran Cudbard-Bell Date: Thu, 19 Jul 2012 11:26:22 +0000 (+0100) Subject: Prevent all threads from blocking if the resource were managing connections for appea... X-Git-Tag: release_3_0_0_beta0~121^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F70%2Fhead;p=thirdparty%2Ffreeradius-server.git Prevent all threads from blocking if the resource were managing connections for appears to be unavailable --- diff --git a/src/main/connection.c b/src/main/connection.c index 4df1dd6293..ee250ded28 100644 --- a/src/main/connection.c +++ b/src/main/connection.c @@ -166,6 +166,14 @@ static fr_connection_t *fr_connection_spawn(fr_connection_pool_t *fc, rad_assert(fc != NULL); + /* + * Prevent all threads from blocking if the resource + * were managing connections for appears to be unavailable. + */ + if ((fc->num == 0) && fc->spawning) { + return NULL; + } + pthread_mutex_lock(&fc->mutex); rad_assert(fc->num <= fc->max);