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

+2 -7
View File
@@ -82,12 +82,7 @@ void mg_sntp_request(struct mg_connection *c) {
}
struct mg_connection *mg_sntp_connect(struct mg_mgr *mgr, const char *url,
mg_event_handler_t fn, void *fnd) {
struct mg_connection *c = NULL;
mg_event_handler_t fn, void *fn_data) {
if (url == NULL) url = "udp://time.google.com:123";
if ((c = mg_connect(mgr, url, fn, fnd)) != NULL) {
c->pfn = sntp_cb;
sntp_cb(c, MG_EV_OPEN, (void *) url);
}
return c;
return mg_connect_svc(mgr, url, fn, fn_data, sntp_cb, NULL);
}