diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/microhttpd/connection.c | 4 | ||||
-rw-r--r-- | 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) | |||
3534 | bool instant_retry; | 3534 | bool instant_retry; |
3535 | char *buffer_head; | 3535 | char *buffer_head; |
3536 | 3536 | ||
3537 | connection->rq.some_payload_processed = false; | ||
3538 | |||
3539 | mhd_assert (NULL == connection->rp.response); | 3537 | mhd_assert (NULL == connection->rp.response); |
3540 | 3538 | ||
3541 | buffer_head = connection->read_buffer; | 3539 | buffer_head = connection->read_buffer; |
@@ -3546,6 +3544,8 @@ process_request_body (struct MHD_Connection *connection) | |||
3546 | size_t left_unprocessed; | 3544 | size_t left_unprocessed; |
3547 | size_t processed_size; | 3545 | size_t processed_size; |
3548 | 3546 | ||
3547 | connection->rq.some_payload_processed = false; | ||
3548 | |||
3549 | instant_retry = false; | 3549 | instant_retry = false; |
3550 | if (connection->rq.have_chunked_upload) | 3550 | if (connection->rq.have_chunked_upload) |
3551 | { | 3551 | { |
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 | |||
1132 | uint64_t current_chunk_offset; | 1132 | uint64_t current_chunk_offset; |
1133 | 1133 | ||
1134 | /** | 1134 | /** |
1135 | * Indicate that some of the upload payload data have been processed | 1135 | * Indicate that some of the upload payload data (from the currently |
1136 | * by the last call of the connection handler. | 1136 | * processed chunk for chunked uploads) have been processed by the |
1137 | * last call of the connection handler. | ||
1137 | * If any data have been processed, but some data left in the buffer | 1138 | * If any data have been processed, but some data left in the buffer |
1138 | * for further processing, then MHD will use zero timeout before the | 1139 | * for further processing, then MHD will use zero timeout before the |
1139 | * next data processing round. | 1140 | * next data processing round. This allow the application handler |
1141 | * process the data by the fixed portions or other way suitable for | ||
1142 | * application developer. | ||
1140 | * If no data have been processed, than MHD will wait for more data | 1143 | * If no data have been processed, than MHD will wait for more data |
1141 | * to come (as it makes no sense to call the connection handler with | 1144 | * to come (as it makes no sense to call the same connection handler |
1142 | * the same conditions). | 1145 | * under the same conditions). However this is dangerous as if buffer |
1146 | * is completely used then connection is aborted. Connection | ||
1147 | * suspension should be used in such case. | ||
1143 | */ | 1148 | */ |
1144 | bool some_payload_processed; | 1149 | bool some_payload_processed; |
1145 | 1150 | ||