]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Need to mark the connection as unused before attempting to close it
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 11 Jul 2012 09:51:49 +0000 (10:51 +0100)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 11 Jul 2012 09:51:49 +0000 (10:51 +0100)
src/main/connection.c

index e545cdafe7e96167f46021f066a602bad7c5697b..cd12233801833c9348654d8558b16898badca19c 100644 (file)
@@ -700,7 +700,7 @@ void *fr_connection_reconnect(fr_connection_pool_t *fc, void *conn)
 
        if (!fc || !conn) return NULL;
 
-       this= fr_connection_find(fc, conn);
+       this = fr_connection_find(fc, conn);
        if (!this) return NULL;
        
        conn_number = this->number;
@@ -718,8 +718,13 @@ void *fr_connection_reconnect(fr_connection_pool_t *fc, void *conn)
                } else {
                        fc->last_complained = now;
                }
-               
-               fr_connection_close(fc, conn);
+       
+               this->used = FALSE;
+
+               rad_assert(fc->active > 0);
+               fc->active--;
+       
+               fr_connection_close(fc, this);
                pthread_mutex_unlock(&fc->mutex);
                
                /*