mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-31 13:00:49 +00:00
Nit refactor
This commit is contained in:
1 parent
18c5b0c277
commit
56716b5eba
8 files changed
+60
-42
No files matched your search
@@ -30,17 +30,22 @@ static struct mg_field fields[] = {
|
||||
{NULL, 0, 0, 0},
|
||||
};
|
||||
|
||||
void run_mongoose(void) {
|
||||
struct mg_mgr mgr;
|
||||
struct mg_dash dash = {fields};
|
||||
struct mg_mgr mgr;
|
||||
struct mg_dash dash = {fields};
|
||||
|
||||
void mongoose_init(void) {
|
||||
mg_mgr_init(&mgr);
|
||||
mg_http_listen(&mgr, HTTP_ADDR, mg_dash_ev_handler, &dash);
|
||||
for (;;) {
|
||||
mg_mgr_poll(&mgr, 10);
|
||||
}
|
||||
}
|
||||
|
||||
void mongoose_poll(void) {
|
||||
mg_mgr_poll(&mgr, 1);
|
||||
}
|
||||
|
||||
int main(void) {
|
||||
run_mongoose();
|
||||
mongoose_init();
|
||||
for (;;) {
|
||||
mongoose_poll();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
Reference in new issue
Block a user