commit ebb17e5da7ea1cca1a2ffa25ef66d6ae3fe764f6 parent db4d4cb4bd70ff330750a8605376f41071498681 Author: Evgeny Grin (Karlson2k) <k2k@narod.ru> Date: Tue, 27 Sep 2022 14:54:05 +0300 connection: skip no-op calling of body generation functions when response body is not used Diffstat:
| M | src/microhttpd/connection.c | | | 11 | ++++++++--- |
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c @@ -5091,10 +5091,15 @@ MHD_connection_handle_idle (struct MHD_Connection *connection) } #endif /* UPGRADE_SUPPORT */ - if (connection->rp.props.chunked) - connection->state = MHD_CONNECTION_CHUNKED_BODY_UNREADY; + if (connection->rp.props.send_reply_body) + { + if (connection->rp.props.chunked) + connection->state = MHD_CONNECTION_CHUNKED_BODY_UNREADY; + else + connection->state = MHD_CONNECTION_NORMAL_BODY_UNREADY; + } else - connection->state = MHD_CONNECTION_NORMAL_BODY_UNREADY; + connection->state = MHD_CONNECTION_FOOTERS_SENT; continue; case MHD_CONNECTION_NORMAL_BODY_READY: /* nothing to do here */