MQTT: support for properties feature added

This commit is contained in:
robert committed 2023-04-23 16:35:50 +03:00
1 parent 44bf059b2f
commit 6c13df1aff
13 files changed
+1740 -1341

No files matched your search

+6 -1
View File
@@ -103,7 +103,12 @@ static void fn(struct mg_connection *c, int ev, void *ev_data, void *fn_data) {
mm->data.ptr, (int) mm->topic.len, mm->topic.ptr));
for (struct sub *sub = s_subs; sub != NULL; sub = sub->next) {
if (mg_match(mm->topic, sub->topic, NULL)) {
mg_mqtt_pub(sub->c, mm->topic, mm->data, 1, false);
struct mg_mqtt_opts pub_opts;
memset(&pub_opts, 0, sizeof(pub_opts));
pub_opts.topic = mm->topic;
pub_opts.message = mm->data;
pub_opts.qos = 1, pub_opts.retain = false;
mg_mqtt_pub(sub->c, &pub_opts);
}
}
break;