mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-20 19:41:58 +00:00
Add TLS=mbedtls option
This commit is contained in:
1 parent
f961f993c8
commit
59e3b0285a
5 files changed
+90
-7
No files matched your search
@@ -72,6 +72,15 @@ static int event_next(int no, struct event *e) {
|
||||
return no + 1;
|
||||
}
|
||||
|
||||
// This is for newlib and TLS (mbedTLS)
|
||||
int _gettimeofday(struct timeval *tv, void *tz) {
|
||||
uint64_t now = mg_millis() + s_boot_timestamp;
|
||||
(void) tz;
|
||||
tv->tv_sec = (time_t) (now / 1000);
|
||||
tv->tv_usec = (unsigned long) ((now % 1000) * 1000);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// SNTP connection event handler. When we get a response from an SNTP server,
|
||||
// adjust s_boot_timestamp. We'll get a valid time from that point on
|
||||
static void sfn(struct mg_connection *c, int ev, void *ev_data, void *fn_data) {
|
||||
|
||||
Reference in new issue
Block a user