Call the thread cleanup code when requesting status

This ensures the correct number of connected clients is returned when
the status command is issued.

Previously the thread pool would only be cleaned up on a new connection.
This commit is contained in:
Patrick J Cherry
2018-02-16 12:58:03 +00:00
parent 9f56f38f42
commit d0439dab88
2 changed files with 12 additions and 0 deletions

View File

@@ -332,6 +332,8 @@ int server_count_clients( struct server *params )
{
NULLCHECK( params );
int i, count = 0;
cleanup_client_threads( params->nbd_client, params->max_nbd_clients );
for ( i = 0 ; i < params->max_nbd_clients ; i++ ) {
if ( params->nbd_client[i].thread != 0 ) {