diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2021-06-04 12:59:45 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2021-06-04 12:59:45 +0300 |
commit | 9ca0b36ab0de26a0e2564f27fa25b6680965c196 (patch) | |
tree | e4bccf5c7f42d7a3e2a3ac7b4b9c12fff46a2b53 | |
parent | cdc1db3d2f1f9f68b2bc35b3903f49480a9181a7 (diff) | |
download | libmicrohttpd-9ca0b36ab0de26a0e2564f27fa25b6680965c196.tar.gz libmicrohttpd-9ca0b36ab0de26a0e2564f27fa25b6680965c196.zip |
connection: do not spend time on building footers for zero-sized responses
Footers are not used for non-chunked responses.
-rw-r--r-- | src/microhttpd/connection.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c index 938031c4..321952eb 100644 --- a/src/microhttpd/connection.c +++ b/src/microhttpd/connection.c | |||
@@ -3779,7 +3779,11 @@ MHD_connection_handle_idle (struct MHD_Connection *connection) | |||
3779 | if (NULL != connection->response->crc) | 3779 | if (NULL != connection->response->crc) |
3780 | MHD_mutex_unlock_chk_ (&connection->response->mutex); | 3780 | MHD_mutex_unlock_chk_ (&connection->response->mutex); |
3781 | #endif | 3781 | #endif |
3782 | connection->state = MHD_CONNECTION_BODY_SENT; | 3782 | /* TODO: replace with 'use_chunked_send' */ |
3783 | if (connection->have_chunked_upload) | ||
3784 | connection->state = MHD_CONNECTION_BODY_SENT; | ||
3785 | else | ||
3786 | connection->state = MHD_CONNECTION_FOOTERS_SENT; | ||
3783 | continue; | 3787 | continue; |
3784 | } | 3788 | } |
3785 | if (MHD_NO != try_ready_normal_body (connection)) | 3789 | if (MHD_NO != try_ready_normal_body (connection)) |