MQTT ignores too many handlers registered
On MQTTClient.c function mqtt_subscribe, if more than MQTT_MAX_MESSAGE_HANDLERS are registered, the variable rc receives the value of grantedQoS. If grantedQoS = 0, and all handlers are already occupied, it goes on and returns 0 to the caller.
This commit is contained in:
parent
abe3b8fd68
commit
ca110fa645
1 changed files with 2 additions and 0 deletions
|
@ -424,6 +424,8 @@ int mqtt_subscribe(mqtt_client_t* c, const char* topic, enum mqtt_qos qos, mqtt
|
||||||
if (rc != 0x80)
|
if (rc != 0x80)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
rc = MQTT_FAILURE;
|
||||||
for (i = 0; i < MQTT_MAX_MESSAGE_HANDLERS; ++i)
|
for (i = 0; i < MQTT_MAX_MESSAGE_HANDLERS; ++i)
|
||||||
{
|
{
|
||||||
if (c->messageHandlers[i].topicFilter == 0)
|
if (c->messageHandlers[i].topicFilter == 0)
|
||||||
|
|
Loading…
Reference in a new issue