aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>2021-11-22 16:35:48 +0300
committerEvgeny Grin (Karlson2k) <k2k@narod.ru>2021-11-24 19:07:40 +0300
commit71cff2d6a38e7917480a25c1310e57115ae5e5e7 (patch)
tree275d7b9a3a9eff3a53af1cdb65457879244463bc
parent85dbd8dc522a6dc83d64619d1cdf603ef9461dcc (diff)
downloadlibmicrohttpd-71cff2d6a38e7917480a25c1310e57115ae5e5e7.tar.gz
libmicrohttpd-71cff2d6a38e7917480a25c1310e57115ae5e5e7.zip
process_request_body(): replaced 'int' with 'bool'
-rw-r--r--src/microhttpd/connection.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index 442189a4..6b355ba3 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -3077,7 +3077,7 @@ process_request_body (struct MHD_Connection *connection)
3077{ 3077{
3078 struct MHD_Daemon *daemon = connection->daemon; 3078 struct MHD_Daemon *daemon = connection->daemon;
3079 size_t available; 3079 size_t available;
3080 int instant_retry; 3080 bool instant_retry;
3081 char *buffer_head; 3081 char *buffer_head;
3082 3082
3083 if (NULL != connection->response) 3083 if (NULL != connection->response)
@@ -3107,7 +3107,7 @@ process_request_body (struct MHD_Connection *connection)
3107 size_t left_unprocessed; 3107 size_t left_unprocessed;
3108 size_t processed_size; 3108 size_t processed_size;
3109 3109
3110 instant_retry = MHD_NO; 3110 instant_retry = false;
3111 if ( (connection->have_chunked_upload) && 3111 if ( (connection->have_chunked_upload) &&
3112 (MHD_SIZE_UNKNOWN == connection->remaining_upload_size) ) 3112 (MHD_SIZE_UNKNOWN == connection->remaining_upload_size) )
3113 { 3113 {
@@ -3152,7 +3152,7 @@ process_request_body (struct MHD_Connection *connection)
3152 { /* cur_chunk_left <= (size_t)available */ 3152 { /* cur_chunk_left <= (size_t)available */
3153 to_be_processed = (size_t) cur_chunk_left; 3153 to_be_processed = (size_t) cur_chunk_left;
3154 if (available > to_be_processed) 3154 if (available > to_be_processed)
3155 instant_retry = MHD_YES; 3155 instant_retry = true;
3156 } 3156 }
3157 } 3157 }
3158 else 3158 else
@@ -3222,7 +3222,7 @@ process_request_body (struct MHD_Connection *connection)
3222 connection->current_chunk_offset = 0; 3222 connection->current_chunk_offset = 0;
3223 3223
3224 if (available > 0) 3224 if (available > 0)
3225 instant_retry = MHD_YES; 3225 instant_retry = true;
3226 if (0LLU == connection->current_chunk_size) 3226 if (0LLU == connection->current_chunk_size)
3227 { 3227 {
3228 connection->remaining_upload_size = 0; 3228 connection->remaining_upload_size = 0;
@@ -3279,7 +3279,7 @@ process_request_body (struct MHD_Connection *connection)
3279 ); 3279 );
3280 if (0 != left_unprocessed) 3280 if (0 != left_unprocessed)
3281 { 3281 {
3282 instant_retry = MHD_NO; /* client did not process everything */ 3282 instant_retry = false; /* client did not process everything */
3283#ifdef HAVE_MESSAGES 3283#ifdef HAVE_MESSAGES
3284 /* client did not process all upload data, complain if 3284 /* client did not process all upload data, complain if
3285 the setup was incorrect, which may prevent us from 3285 the setup was incorrect, which may prevent us from
@@ -3299,8 +3299,7 @@ process_request_body (struct MHD_Connection *connection)
3299 available -= processed_size; 3299 available -= processed_size;
3300 if (MHD_SIZE_UNKNOWN != connection->remaining_upload_size) 3300 if (MHD_SIZE_UNKNOWN != connection->remaining_upload_size)
3301 connection->remaining_upload_size -= processed_size; 3301 connection->remaining_upload_size -= processed_size;
3302 } 3302 } while (instant_retry);
3303 while (MHD_NO != instant_retry);
3304 /* TODO: zero out reused memory region */ 3303 /* TODO: zero out reused memory region */
3305 if ( (available > 0) && 3304 if ( (available > 0) &&
3306 (buffer_head != connection->read_buffer) ) 3305 (buffer_head != connection->read_buffer) )