aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>2022-09-27 14:54:05 +0300
committerEvgeny Grin (Karlson2k) <k2k@narod.ru>2022-09-27 14:54:05 +0300
commitebb17e5da7ea1cca1a2ffa25ef66d6ae3fe764f6 (patch)
tree62f971016f41cab09ac62f3e9add4776860237b2
parentdb4d4cb4bd70ff330750a8605376f41071498681 (diff)
downloadlibmicrohttpd-ebb17e5da7ea1cca1a2ffa25ef66d6ae3fe764f6.tar.gz
libmicrohttpd-ebb17e5da7ea1cca1a2ffa25ef66d6ae3fe764f6.zip
connection: skip no-op calling of body generation functions when response body is not used
-rw-r--r--src/microhttpd/connection.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index f33f9a9f..7624711a 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -5091,10 +5091,15 @@ MHD_connection_handle_idle (struct MHD_Connection *connection)
5091 } 5091 }
5092#endif /* UPGRADE_SUPPORT */ 5092#endif /* UPGRADE_SUPPORT */
5093 5093
5094 if (connection->rp.props.chunked) 5094 if (connection->rp.props.send_reply_body)
5095 connection->state = MHD_CONNECTION_CHUNKED_BODY_UNREADY; 5095 {
5096 if (connection->rp.props.chunked)
5097 connection->state = MHD_CONNECTION_CHUNKED_BODY_UNREADY;
5098 else
5099 connection->state = MHD_CONNECTION_NORMAL_BODY_UNREADY;
5100 }
5096 else 5101 else
5097 connection->state = MHD_CONNECTION_NORMAL_BODY_UNREADY; 5102 connection->state = MHD_CONNECTION_FOOTERS_SENT;
5098 continue; 5103 continue;
5099 case MHD_CONNECTION_NORMAL_BODY_READY: 5104 case MHD_CONNECTION_NORMAL_BODY_READY:
5100 /* nothing to do here */ 5105 /* nothing to do here */