Fix some PUBLISH messages not being counted in $SYS stats.

Closes #2448. Thanks to Antoine.
This commit is contained in:
Roger A. Light 2022-08-08 00:29:37 +01:00
parent ba6bbd5959
commit a913de2d28
3 changed files with 4 additions and 3 deletions

View File

@ -15,6 +15,7 @@ Broker:
persistence. Closes #2546.
- Fix bridges not sending failure notification messages to the local broker if
the remote bridge connection fails. Closes #2467. Closes #1488.
- Fix some PUBLISH messages not being counted in $SYS stats. Closes #2448.
Client library:
- Fix threads library detection on Windows under cmake. Bumps the minimum

View File

@ -546,7 +546,7 @@ int packet__read(struct mosquitto *mosq)
mosq->in_packet.pos = 0;
#ifdef WITH_BROKER
G_MSGS_RECEIVED_INC(1);
if(((mosq->in_packet.command)&0xF5) == CMD_PUBLISH){
if(((mosq->in_packet.command)&0xF0) == CMD_PUBLISH){
G_PUB_MSGS_RECEIVED_INC(1);
}
#endif

View File

@ -261,7 +261,7 @@ static int callback_mqtt(
#ifdef WITH_SYS_TREE
g_msgs_sent++;
if(((packet->command)&0xF6) == CMD_PUBLISH){
if(((packet->command)&0xF0) == CMD_PUBLISH){
g_pub_msgs_sent++;
}
#endif
@ -356,7 +356,7 @@ static int callback_mqtt(
#ifdef WITH_SYS_TREE
G_MSGS_RECEIVED_INC(1);
if(((mosq->in_packet.command)&0xF5) == CMD_PUBLISH){
if(((mosq->in_packet.command)&0xF0) == CMD_PUBLISH){
G_PUB_MSGS_RECEIVED_INC(1);
}
#endif