Indicate in log whether subscribe succeeded

This commit is contained in:
Roger A. Light
2024-02-07 13:21:12 +00:00
parent 6e7784f096
commit 7ce732a4a1
+5 -1
View File
@@ -176,7 +176,6 @@ int handle__subscribe(struct mosquitto *context)
sub.topic_filter = sub_mount;
}
log__printf(NULL, MOSQ_LOG_DEBUG, "\t%s (QoS %d)", sub.topic_filter, qos);
allowed = true;
rc2 = mosquitto_acl_check(context, sub.topic_filter, 0, NULL, qos, false, MOSQ_ACL_SUBSCRIBE);
@@ -195,6 +194,11 @@ int handle__subscribe(struct mosquitto *context)
mosquitto__FREE(sub.topic_filter);
return rc2;
}
if(qos > 127){
log__printf(NULL, MOSQ_LOG_DEBUG, "\t%s (denied)", sub.topic_filter);
}else{
log__printf(NULL, MOSQ_LOG_DEBUG, "\t%s (QoS %d)", sub.topic_filter, qos);
}
if(allowed){
rc2 = plugin__handle_subscribe(context, &sub);