mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-07 16:01:30 +00:00
Do not create socket until resolved
This commit is contained in:
1 parent
ddb700eee5
commit
b93456f512
14 files changed
+162
-173
No files matched your search
+2
-2
@@ -1,7 +1,7 @@
|
||||
#include "sntp.h"
|
||||
#include "arch.h"
|
||||
#include "event.h"
|
||||
#include "log.h"
|
||||
#include "sntp.h"
|
||||
#include "util.h"
|
||||
|
||||
#define SNTP_INTERVAL_SEC (3600)
|
||||
@@ -49,7 +49,7 @@ static void sntp_cb(struct mg_connection *c, int ev, void *evd, void *fnd) {
|
||||
|
||||
void mg_sntp_send(struct mg_connection *c, unsigned long utc) {
|
||||
if (c->is_resolving) {
|
||||
LOG(LL_ERROR, ("%p wait until resolved", c->fd));
|
||||
LOG(LL_ERROR, ("%lu wait until resolved", c->id));
|
||||
} else if (utc > s_sntmp_next) {
|
||||
uint8_t buf[48] = {0};
|
||||
s_sntmp_next = utc + SNTP_INTERVAL_SEC;
|
||||
|
||||
Reference in new issue
Block a user