commit 792a413f7d9d1e52dc41c69024cad685cbd401da parent b0056d621f97f82682becb1a1b459818af341de6 Author: Evgeny Grin (Karlson2k) <k2k@drgrin.dev> Date: Sun, 23 Aug 2026 15:22:47 +0200 POST parser: improved code compatibility with planned changes Diffstat:
| M | src/mhd2/stream_process_request.c | | | 8 | +++++++- |
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/mhd2/stream_process_request.c b/src/mhd2/stream_process_request.c @@ -3682,7 +3682,13 @@ process_request_nonchunked_body (struct MHD_Connection *restrict c) c->discard_request = true; read_buf_reuse = true; - c->rq.cntn.proc_size += cntn_data_ready; + /* Only the data actually taken by the parser is "processed". + Currently the parser takes all the provided data, unless it failed to + get enough large buffer memory. + TODO: in-place processing will require reworking the "recv_size" + accounting above and the read buffer reuse as well. */ + mhd_assert (size_provided <= cntn_data_ready); + c->rq.cntn.proc_size += cntn_data_ready - size_provided; if (c->rq.cntn.recv_size == c->rq.cntn.cntn_size) { c->stage = mhd_HTTP_STAGE_FULL_REQ_RECEIVED;