From e5d8dd37291b57012c58d1a839505bf287a2965a Mon Sep 17 00:00:00 2001 From: Dmitry Volyntsev Date: Tue, 5 May 2026 16:21:57 -0700 Subject: [PATCH] Development guide: clarified unbuffered request body reading. Noted that the request body post handler can be called before the whole body is read in unbuffered mode. Clarified that NGX_AGAIN from ngx_http_read_unbuffered_request_body() can also mean blocked buffer space, and narrowed read_event_handler wording to client body data availability. --- xml/en/docs/dev/development_guide.xml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/xml/en/docs/dev/development_guide.xml b/xml/en/docs/dev/development_guide.xml index e08d9ad42..ee13a268e 100644 --- a/xml/en/docs/dev/development_guide.xml +++ b/xml/en/docs/dev/development_guide.xml @@ -9,7 +9,7 @@
+ rev="13">
@@ -5542,6 +5542,7 @@ When the body is completely read, the post_handler callback is called to continue processing the request. If the request body is missing or has already been read, the callback is called immediately. +In unbuffered mode, the callback can be called before the whole body is read. The function ngx_http_read_client_request_body(r, post_handler) allocates the request_body request field of type @@ -5675,14 +5676,16 @@ unbuffered mode of reading a request body. In this mode, after calling ngx_http_read_client_request_body(), the bufs chain might keep only a part of the body. +The request flag reading_body indicates that the request body +reading is still in progress. To read the next part, call the ngx_http_read_unbuffered_request_body(r) function. -The return value NGX_AGAIN and the request flag -reading_body indicate that more data is available. -If bufs is NULL after calling this function, there is -nothing to read at the moment. +The return value NGX_AGAIN indicates that more body data +or buffer space is needed. +If bufs is NULL after calling this function, no body data is +available at the moment. The request callback read_event_handler will be called when -the next part of request body is available. +more client body data is available.