This commit is contained in:
Sergio R. Caprile 2023-07-25 11:37:01 -03:00
commit 91a638156c
3 changed files with 12 additions and 0 deletions

View File

@ -86,3 +86,13 @@ int mkdir(const char *path, mode_t mode) {
}
void _init(void) {}
extern uint64_t mg_now(void);
int _gettimeofday(struct timeval *tv, void *tz) {
uint64_t now = mg_now();
(void) tz;
tv->tv_sec = (time_t) (now / 1000);
tv->tv_usec = (unsigned long) ((now % 1000) * 1000);
return 0;
}

View File

@ -5774,6 +5774,7 @@ void mg_tls_ctx_free(struct mg_mgr *mgr) {
mbedtls_x509_crt_free(&ctx->client_cert);
mbedtls_pk_free(&ctx->client_key);
mbedtls_x509_crt_free(&ctx->client_ca);
mbedtls_x509_crt_free(&ctx->server_ca);
#ifdef MBEDTLS_SSL_SESSION_TICKETS
mbedtls_ssl_ticket_free(&ctx->ticket_ctx);
#endif

View File

@ -241,6 +241,7 @@ void mg_tls_ctx_free(struct mg_mgr *mgr) {
mbedtls_x509_crt_free(&ctx->client_cert);
mbedtls_pk_free(&ctx->client_key);
mbedtls_x509_crt_free(&ctx->client_ca);
mbedtls_x509_crt_free(&ctx->server_ca);
#ifdef MBEDTLS_SSL_SESSION_TICKETS
mbedtls_ssl_ticket_free(&ctx->ticket_ctx);
#endif