[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 22/29: Minor refactoring for partially processed request
From: |
gnunet |
Subject: |
[libmicrohttpd] 22/29: Minor refactoring for partially processed request body |
Date: |
Tue, 20 Jun 2023 22:24:35 +0200 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit f7bae2ce3ea4c4ef4082a754a105982c84828698
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Sat Jun 17 17:22:54 2023 +0300
Minor refactoring for partially processed request body
---
src/microhttpd/connection.c | 4 ++--
src/microhttpd/internal.h | 15 ++++++++++-----
2 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index 227fb625..453296eb 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -3534,8 +3534,6 @@ process_request_body (struct MHD_Connection *connection)
bool instant_retry;
char *buffer_head;
- connection->rq.some_payload_processed = false;
-
mhd_assert (NULL == connection->rp.response);
buffer_head = connection->read_buffer;
@@ -3546,6 +3544,8 @@ process_request_body (struct MHD_Connection *connection)
size_t left_unprocessed;
size_t processed_size;
+ connection->rq.some_payload_processed = false;
+
instant_retry = false;
if (connection->rq.have_chunked_upload)
{
diff --git a/src/microhttpd/internal.h b/src/microhttpd/internal.h
index 651e6170..909e24d4 100644
--- a/src/microhttpd/internal.h
+++ b/src/microhttpd/internal.h
@@ -1132,14 +1132,19 @@ struct MHD_Request
uint64_t current_chunk_offset;
/**
- * Indicate that some of the upload payload data have been processed
- * by the last call of the connection handler.
+ * Indicate that some of the upload payload data (from the currently
+ * processed chunk for chunked uploads) have been processed by the
+ * last call of the connection handler.
* If any data have been processed, but some data left in the buffer
* for further processing, then MHD will use zero timeout before the
- * next data processing round.
+ * next data processing round. This allow the application handler
+ * process the data by the fixed portions or other way suitable for
+ * application developer.
* If no data have been processed, than MHD will wait for more data
- * to come (as it makes no sense to call the connection handler with
- * the same conditions).
+ * to come (as it makes no sense to call the same connection handler
+ * under the same conditions). However this is dangerous as if buffer
+ * is completely used then connection is aborted. Connection
+ * suspension should be used in such case.
*/
bool some_payload_processed;
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [libmicrohttpd] 07/29: Removed request line and headers processing old functions and variables, (continued)
- [libmicrohttpd] 07/29: Removed request line and headers processing old functions and variables, gnunet, 2023/06/20
- [libmicrohttpd] 09/29: daemon: added debug member to avoid accept4() usage, gnunet, 2023/06/20
- [libmicrohttpd] 01/29: Refactoring: check whether memory block is resizable, gnunet, 2023/06/20
- [libmicrohttpd] 06/29: Re-implemented parsing of the request headers and footers from scratch., gnunet, 2023/06/20
- [libmicrohttpd] 12/29: Added back testing with socat as a fallback option, gnunet, 2023/06/20
- [libmicrohttpd] 05/29: Request body processing: removed impossible code paths, gnunet, 2023/06/20
- [libmicrohttpd] 16/29: Added tests with single and double folded header, gnunet, 2023/06/20
- [libmicrohttpd] 21/29: process_request_body(): minor readability improvementы, gnunet, 2023/06/20
- [libmicrohttpd] 11/29: testzzuf: re-worked zzuf testing, gnunet, 2023/06/20
- [libmicrohttpd] 10/29: testzzuf: added special debug functions, gnunet, 2023/06/20
- [libmicrohttpd] 22/29: Minor refactoring for partially processed request body,
gnunet <=
- [libmicrohttpd] 14/29: Added test with folded header placed last, gnunet, 2023/06/20
- [libmicrohttpd] 15/29: Added test with large folded header, gnunet, 2023/06/20
- [libmicrohttpd] 20/29: Added checks for correct values specified for connection memory limits, gnunet, 2023/06/20
- [libmicrohttpd] 19/29: connection: fixed pipelined requests processing, gnunet, 2023/06/20
- [libmicrohttpd] 13/29: Added new tests with header fold, gnunet, 2023/06/20
- [libmicrohttpd] 18/29: Added proper connection's buffers pre-initialisaion, gnunet, 2023/06/20
- [libmicrohttpd] 17/29: connection.c: corrected error responses, gnunet, 2023/06/20
- [libmicrohttpd] 24/29: process new connection: fixed missing mutex unlock in error handling path, gnunet, 2023/06/20
- [libmicrohttpd] 23/29: Adjusted buffer increase default step size, gnunet, 2023/06/20
- [libmicrohttpd] 28/29: try_grow_read_buffer(): better handling of edge cases, gnunet, 2023/06/20