MCPcopy Create free account
hub / github.com/cesanta/mongoose / main

Function main

tutorials/http/redirect-to-https/main.c:66–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64}
65
66int main(void) {
67 struct mg_mgr mgr;
68
69 mg_log_set(s_debug_level);
70 mg_mgr_init(&mgr);
71
72 if (mg_http_listen(&mgr, s_http_addr, http_ev_handler, NULL) == NULL) {
73 exit(EXIT_FAILURE);
74 }
75
76 if (mg_http_listen(&mgr, s_https_addr, https_ev_handler, NULL) == NULL) {
77 exit(EXIT_FAILURE);
78 }
79
80 MG_INFO(("Mongoose version : v%s", MG_VERSION));
81 MG_INFO(("HTTP listener : %s", s_http_addr));
82 MG_INFO(("HTTPS listener : %s", s_https_addr));
83 for (;;) {
84 mg_mgr_poll(&mgr, 1000);
85 }
86
87 mg_mgr_free(&mgr);
88 return 0;
89}

Callers

nothing calls this directly

Calls 4

mg_mgr_initFunction · 0.50
mg_http_listenFunction · 0.50
mg_mgr_pollFunction · 0.50
mg_mgr_freeFunction · 0.50

Tested by

no test coverage detected