Skip to content

Commit

Permalink
Remove closed connections from the parent's tracking list
Browse files Browse the repository at this point in the history
  • Loading branch information
ndptech committed Aug 17, 2023
1 parent 3bce1e5 commit bac1129
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/lib/io/master.c
Original file line number Diff line number Diff line change
Expand Up @@ -2574,6 +2574,7 @@ static int mod_close(fr_listen_t *li)
fr_io_instance_t const *inst;
fr_io_connection_t *connection;
fr_listen_t *child;
fr_io_client_t *parent;

get_inst(li, &inst, NULL, &connection, &child);

Expand All @@ -2597,6 +2598,15 @@ static int mod_close(fr_listen_t *li)
if (connection->client->pending) {
TALLOC_FREE(connection->client->pending); /* for any pending packets */
}

/*
* Remove the connection from the parent's connection set
*/
parent = connection->parent;
pthread_mutex_lock(&parent->mutex);
fr_hash_table_remove(parent->ht, connection);
pthread_mutex_unlock(&parent->mutex);

talloc_free(connection->dl_inst);

return 0;
Expand Down

0 comments on commit bac1129

Please sign in to comment.