Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mg_printf_data ignored until next call to mg_poll_server #286

Closed
oli-obk opened this issue Jan 10, 2014 · 1 comment · Fixed by #287
Closed

mg_printf_data ignored until next call to mg_poll_server #286

oli-obk opened this issue Jan 10, 2014 · 1 comment · Fixed by #287

Comments

@oli-obk
Copy link
Contributor

oli-obk commented Jan 10, 2014

  main()
  {
    while (!stop_server) {
        mg_poll_server(server, 1000);
    }
    // one last time does the trick
    mg_poll_server(server, 0);
    mg_destroy_server(&server);
  }
  // somefun is called inside the uri handler
  somefun()
  {
     stop_server = true;
     // message never shows up, server times out
     mg_printf_data(conn, "shutting down");
  }
@cpq
Copy link
Member

cpq commented Jan 10, 2014

Yep, ok, maybe mg_destroy_server() should call mg_poll_server last one time!
Could you add a call to mg_destroy_server() and see if it works please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants