Skip to content

MHD_create_response_from_callback: reuse of response  #73

@IronBug

Description

@IronBug

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions