fix SNTP through proper protocol handler setup

This commit is contained in:
Sergio R. Caprile committed 2025-07-11 16:56:12 -03:00
1 parent 67255ce8f5
commit 8bf9d09d96
8 files changed
+39 -30

No files matched your search

+1 -2
View File
@@ -529,12 +529,11 @@ void mg_mqtt_disconnect(struct mg_connection *c,
struct mg_connection *mg_mqtt_connect(struct mg_mgr *mgr, const char *url,
const struct mg_mqtt_opts *opts,
mg_event_handler_t fn, void *fn_data) {
struct mg_connection *c = mg_connect(mgr, url, fn, fn_data);
struct mg_connection *c = mg_connect_svc(mgr, url, fn, fn_data, mqtt_cb, NULL);
if (c != NULL) {
struct mg_mqtt_opts empty;
memset(&empty, 0, sizeof(empty));
mg_mqtt_login(c, opts == NULL ? &empty : opts);
c->pfn = mqtt_cb;
}
return c;
}