mirror of
https://github.com/eclipse-mosquitto/mosquitto.git
synced 2026-02-06 02:52:07 +08:00
Fix max_connections not being honoured on websockets listeners.
Closes #3455. Thanks to FelixPopp.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
2.0.23 - 2026-01-14
|
||||
2.0.23 - 2026-xx-xx
|
||||
===================
|
||||
|
||||
Broker:
|
||||
@@ -13,6 +13,7 @@ Broker:
|
||||
- Fix potential crash on startup if a malicious/corrupt persistence file from
|
||||
mosquitto 1.5 or earlier is loaded. Closes #3439.
|
||||
- Limit auto_id_prefix to 50 characters. Closes #3440.
|
||||
- Fix max_connections not being honoured on websockets listeners. Closes #3455.
|
||||
|
||||
Windows:
|
||||
- Installer will not overwrite an existing mosquitto.conf
|
||||
|
||||
@@ -170,10 +170,12 @@ static int callback_mqtt(
|
||||
u->mosq = NULL;
|
||||
return -1;
|
||||
}
|
||||
mosq->listener->client_count++;
|
||||
if(mosq->listener->max_connections > 0 && mosq->listener->client_count > mosq->listener->max_connections){
|
||||
if(db.config->connection_messages == true){
|
||||
log__printf(NULL, MOSQ_LOG_NOTICE, "Client connection from %s denied: max_connections exceeded.", mosq->address);
|
||||
}
|
||||
mosq->listener->client_count--;
|
||||
mosquitto__free(mosq->address);
|
||||
mosquitto__free(mosq);
|
||||
u->mosq = NULL;
|
||||
@@ -194,6 +196,7 @@ static int callback_mqtt(
|
||||
HASH_DELETE(hh_sock, db.contexts_by_sock, mosq);
|
||||
mosq->sock = INVALID_SOCKET;
|
||||
mux__delete(mosq);
|
||||
mosq->listener->client_count--;
|
||||
}
|
||||
mosq->wsi = NULL;
|
||||
#ifdef WITH_TLS
|
||||
|
||||
Reference in New Issue
Block a user