Dear friends.
No in fact the question is serious. There is no simple way to let run
MHD on the main thread. It requires implementing an external
poll/select loop.
Can you provide an integrated main that serves and doesn't return until
stopped?
IMHO, it would be really very useful. Unfortunately, without this feature, we need to implement hard logic using select()/epoll() by hand in our console applications.
In Rust and Pascal we generally call some locking function to stay "running" application, in those cases, it would be nice to call something like this:
static int my_awesome_callback(void *cls) {
return application_terminated ? MHD_YES : MHD_NO;
}
MHD_main_loop(my_awesome_callback, NULL);
so the MHD_main_loop() would hold the console application without exiting, something like getchar() does. Many other C/Rust libraries implements this loop, for example:
This is a very appreciated feature in many other libraries/frameworks.
Best regards
José Bollo