]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Prevent all threads from blocking if the resource were managing connections for appea... 70/head
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 19 Jul 2012 11:26:22 +0000 (12:26 +0100)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 19 Jul 2012 11:26:22 +0000 (12:26 +0100)
src/main/connection.c

index 4df1dd62937dcefcb3ed6428e3c459772bd815ab..ee250ded28ba333c351b45165d45ae37adab99b8 100644 (file)
@@ -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);