I have this server using mongoose, which take some request, parse the informations, do an action and return the result.
For exemple, I can query it this way server:port/action?arg1=test&arg2=...
My problem is that any time I query the server I get only "MG_OPEN_FILE" events. And for each request I get 3 of them.
I read that it may be normal to have some in http queries but the problem here is that I don't have any "MG_NEW_REQUEST" events.
Basically, whenever I start the server, the first connection (and all of them after) always returns the following events: MG_OPEN_FILE
MG_OPEN_FILE
MG_OPEN_FILE
MG_REQUEST_COMPLETE
I call my server this way :
int main(int argc, char* argv[]) {
struct mg_context *ctx;
const char *options[] = {"listening_ports", "8080", "num_threads","10", NULL};
ctx = mg_start(&callback, NULL, options);
while(1){
getchar(); // Wait until user hits "enter"
}
mg_stop(ctx);
return 0;
}
And the callback function starts with :
static void *callback(enum mg_event event, struct mg_connection *conn)
{
const struct mg_request_info *request_info = mg_get_request_info(conn);
if (event == MG_NEW_REQUEST)
{
But it is always a "MG_OPEN_FILE" event and I have no clue of the reason :( So if anyone has any idea on the reason of this, I would be extremely thankful !