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);
Another (possible?) option (supposing a function named "MHD_poll"):
int main(void) {
/* some MHD deamon initialization */
while (!terminated) { /* terminated -> e.g.: some termination condition handle by signal */
}
}
So the MHD_poll() would allow to reuse the built in MHD's select/epoll in any external thread (for example, in the main thread of a console application).
Maybe a MHD_poll() is already implemented in MHD in some private function. If so, that function would be very appreciated as an external function. :-)
--