I made a patch for libhttpd-http2 that fixes the problem of connection reset after every request in HTTP/1.1 protocol. I'm not sure it's proper, I think I need to discuss this with developers of libmicrohttpd first (the problem exists in the current trunk version).
anyway, the patch:
--- ./src/microhttpd/connection.c 2021-02-06 10:39:20.630410269 +0500 +++ ./src/microhttpd/connection.c 2021-02-06 14:15:02.148711030 +0500 @@ -4539,7 +4539,7 @@ { /* response was queued "early", refuse to read body / footers or further requests! */ - connection->read_closed = true; + //connection->read_closed = true; /* fix for HTTP/1.1 connection reuse connection->state = MHD_CONNECTION_FOOTERS_RECEIVED; connection->remaining_upload_size = 0; }
#libmicrohttpd #bugfix #programming #C #patch #opensource