update to new API

This commit is contained in:
Sergio R. Caprile committed 2023-07-25 18:41:41 -03:00
1 parent 199af33b30
commit ed54b60ea3
11 files changed
+73 -54

No files matched your search

+2 -1
View File
@@ -101,7 +101,8 @@ int main(int argc, char *argv[]) {
signal(SIGTERM, signal_handler); // manager loop on SIGINT and SIGTERM
mg_mgr_init(&mgr);
mg_tls_init_client(&mgr, "ca.pem");
struct mg_tls_opts opts = {.client_ca = mg_str(CA_ALL)};
mg_tls_ctx_init(&mgr, &opts);
mg_timer_add(&mgr, 3000, MG_TIMER_REPEAT | MG_TIMER_RUN_NOW, timer_fn, &mgr);
while (s_signo == 0) mg_mgr_poll(&mgr, 1000); // Event loop, 1s timeout
mg_mgr_free(&mgr); // Finished, cleanup