mirror of
https://github.com/tsl0922/ttyd.git
synced 2025-12-23 20:24:20 +01:00
Fix client count calculation
This commit is contained in:
@@ -80,8 +80,14 @@ check_host_origin(struct lws *wsi) {
|
|||||||
void
|
void
|
||||||
tty_client_remove(struct tty_client *client) {
|
tty_client_remove(struct tty_client *client) {
|
||||||
pthread_mutex_lock(&server->lock);
|
pthread_mutex_lock(&server->lock);
|
||||||
LIST_REMOVE(client, list);
|
struct tty_client *iterator;
|
||||||
|
LIST_FOREACH(iterator, &server->clients, list) {
|
||||||
|
if (iterator == client) {
|
||||||
|
LIST_REMOVE(iterator, list);
|
||||||
server->client_count--;
|
server->client_count--;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
pthread_mutex_unlock(&server->lock);
|
pthread_mutex_unlock(&server->lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user