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

MHD_create_response_from_callback: reuse of response #73

Open
IronBug opened this issue Jan 17, 2021 · 0 comments
Open

MHD_create_response_from_callback: reuse of response #73

IronBug opened this issue Jan 17, 2021 · 0 comments

Comments

@IronBug
Copy link

IronBug commented Jan 17, 2021

Greetings.
I use your library in my development and I discovered that with HTTP2 the responses created with MHD_create_response_from_callback were not reusable (session hangs on repeating requests).
I debugged the code and created a patch for this case:

index 6a89189e..d536cced 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -4317,6 +4317,9 @@ MHD_queue_response (struct MHD_Connection *connection,
     return MHD_NO;
   daemon = connection->daemon;

+  /* Iron Bug: fix for reusing response from callback */
+  response->data_start = 0;
+
   if (daemon->shutdown)
     return MHD_YES; /* If daemon was shut down in parallel,
                      * response will be aborted now or on later stage. */

I don't make a pull request because I generally don't use GitHub and it's a small patch.

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

No branches or pull requests

1 participant