mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-10 16:31:44 +00:00
fix SNTP through proper protocol handler setup
This commit is contained in:
1 parent
67255ce8f5
commit
8bf9d09d96
8 files changed
+39
-30
No files matched your search
+2
-7
@@ -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);
|
||||
}
|
||||
Reference in new issue
Block a user