diff --git a/README.markdown b/README.markdown index 86084eef44..f8a20b6422 100644 --- a/README.markdown +++ b/README.markdown @@ -5639,7 +5639,7 @@ Returns a read-only cosocket object that wraps the downstream connection. Only [ In case of error, `nil` will be returned as well as a string describing the error. -Due to the streaming nature of HTTP2 and HTTP3, When the downstream connection maintains a continuous stream (such as GRPC), a block will occur. The block time depends on the [client_body_timeout](http://nginx.org/en/docs/http/ngx_http_core_module.html#client_body_timeout) setting. After the timeout, all Lua codes will be skipped and a 408 status code will be returned. [#2286](https://github.com/openresty/lua-nginx-module/pull/2286) +Note: This method will block while waiting for client request to be fully received. The block time depends on the [client_body_timeout](http://nginx.org/en/docs/http/ngx_http_core_module.html#client_body_timeout) directive and maximum body size specified by the [client_max_body_size](http://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size) directive. If read timeout occurs or client body size exceeds the defined limit, this function will not return and 408 Request Time-out or 413 Request Entity Too Large response will be returned to the client instead. The socket object returned by this method is usually used to read the current request's body in a streaming fashion. Do not turn on the [lua_need_request_body](#lua_need_request_body) directive, and do not mix this call with [ngx.req.read_body](#ngxreqread_body) and [ngx.req.discard_body](#ngxreqdiscard_body). diff --git a/doc/HttpLuaModule.wiki b/doc/HttpLuaModule.wiki index b4bf92c865..5a0be3af32 100644 --- a/doc/HttpLuaModule.wiki +++ b/doc/HttpLuaModule.wiki @@ -4741,8 +4741,7 @@ Returns a read-only cosocket object that wraps the downstream connection. Only [ In case of error, nil will be returned as well as a string describing the error. -Due to the streaming nature of HTTP2 and HTTP3, When the downstream connection maintains a continuous stream (such as GRPC), a block will occur. The block time depends on the [http://nginx.org/en/docs/http/ngx_http_core_module.html#client_body_timeout client_body_timeout] setting. After the timeout, all Lua codes will be skipped and a 408 status code will be returned. [https://github.com/openresty/lua-nginx-module/pull/2286 #2286] - +Note: This method will block while waiting for client request to be fully received. The block time depends on the [http://nginx.org/en/docs/http/ngx_http_core_module.html#client_body_timeout client_body_timeout] directive and maximum body size specified by the [http://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size client_max_body_size] directive. If read timeout occurs or client body size exceeds the defined limit, this function will not return and 408 Request Time-out or 413 Request Entity Too Large response will be returned to the client instead. The socket object returned by this method is usually used to read the current request's body in a streaming fashion. Do not turn on the [[#lua_need_request_body|lua_need_request_body]] directive, and do not mix this call with [[#ngx.req.read_body|ngx.req.read_body]] and [[#ngx.req.discard_body|ngx.req.discard_body]]. If any request body data has been pre-read into the Nginx core request header buffer, the resulting cosocket object will take care of this to avoid potential data loss resulting from such pre-reading.