Currently I'm working on an application which embeds the mongoose webserver. In some cases, I have to call additional functions inside the begin_request_handler
to create the desired HTTP header. During this, I realized that theses functions are called after the request handler is done. For example:
void test() {
printf("HELLO");
}
static int begin_request_handler(struct mg_connection *conn) {
test();
const struct mg_request_info *request_info = mg_get_request_info(conn);
...
return 1;
}
Here the HELLO is getting printed right after the browser closes the tcp connection. Is there even a way to call functions from inside the callbacks? Or am I just missing something?