commit 71cff2d6a38e7917480a25c1310e57115ae5e5e7
parent 85dbd8dc522a6dc83d64619d1cdf603ef9461dcc
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date: Mon, 22 Nov 2021 16:35:48 +0300
process_request_body(): replaced 'int' with 'bool'
Diffstat:
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
@@ -3077,7 +3077,7 @@ process_request_body (struct MHD_Connection *connection)
{
struct MHD_Daemon *daemon = connection->daemon;
size_t available;
- int instant_retry;
+ bool instant_retry;
char *buffer_head;
if (NULL != connection->response)
@@ -3107,7 +3107,7 @@ process_request_body (struct MHD_Connection *connection)
size_t left_unprocessed;
size_t processed_size;
- instant_retry = MHD_NO;
+ instant_retry = false;
if ( (connection->have_chunked_upload) &&
(MHD_SIZE_UNKNOWN == connection->remaining_upload_size) )
{
@@ -3152,7 +3152,7 @@ process_request_body (struct MHD_Connection *connection)
{ /* cur_chunk_left <= (size_t)available */
to_be_processed = (size_t) cur_chunk_left;
if (available > to_be_processed)
- instant_retry = MHD_YES;
+ instant_retry = true;
}
}
else
@@ -3222,7 +3222,7 @@ process_request_body (struct MHD_Connection *connection)
connection->current_chunk_offset = 0;
if (available > 0)
- instant_retry = MHD_YES;
+ instant_retry = true;
if (0LLU == connection->current_chunk_size)
{
connection->remaining_upload_size = 0;
@@ -3279,7 +3279,7 @@ process_request_body (struct MHD_Connection *connection)
);
if (0 != left_unprocessed)
{
- instant_retry = MHD_NO; /* client did not process everything */
+ instant_retry = false; /* client did not process everything */
#ifdef HAVE_MESSAGES
/* client did not process all upload data, complain if
the setup was incorrect, which may prevent us from
@@ -3299,8 +3299,7 @@ process_request_body (struct MHD_Connection *connection)
available -= processed_size;
if (MHD_SIZE_UNKNOWN != connection->remaining_upload_size)
connection->remaining_upload_size -= processed_size;
- }
- while (MHD_NO != instant_retry);
+ } while (instant_retry);
/* TODO: zero out reused memory region */
if ( (available > 0) &&
(buffer_head != connection->read_buffer) )