gnunet-svn
[Top][All Lists]
Advanced

[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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]