Adding ngx.req.init_body() ngx.req.append_body() ngx.req.finish_body()
various coding style fixes in Matthieu Tourne's patch for adding ngx.req.init_body(), ngx.req.append_body(), and ngx.req.finish_body(). also made the size argument optional in ngx.req.init_body() in which case the client_body_buffer_size configuration is honored.
Update code, still using GLOBALS_SYMBOL_REQUEST. See Commit 89a997.
Adding code similar to nginx core, to prevent allocating buffers much larger than the request itself.
Merge remote-tracking branch 'upstream/master' into req-body
Merge branch 'master' into req-body
ngx.req.init_body: when the size argument is specified, honor that exactly; when the size argument is omitted, use the same logic as ngx_http_read_client_request_body to calculate the buffer size.
Merge branch 'master' into req-body
optimize: fixed the initial table size for ngx.req.
documented the init_by_lua* directives and also bumped version number to 0.5.5.
bugfix: ngx.exit(404/403/500/...) would throw out Lua errors when the response headers with exactly the same status code had already been sent. thanks Matthieu Tourne for reporting this.
updated the TODO list in docs to reflect recent changes.
bugfix: ngx.exec() did not accept the nil value for its second (optional) argument.
checked in a (skipped) test case for subrequest request headers handling.
bugfix: we should always test if the request object pointer is null in the ngx.req.*_body API.
feature: added new Nginx API for Lua: ngx.req.set_method(method_id) and ngx.req.get_method. thanks Matthieu Tourne for suggesting these.
bugfix: ngx.req.clear_header() did not remove all the instances for the builtin headers or custom headers. bugfix: ngx.req.clear_header() might accidentally remove request headers that are not specified at all and leave the specified headers with just empty header values when removing multiple built-in headers. thanks Matthieu Tourne for reporting the issues.
bugfix: tcpsock:receive() and tcpsock:send() always returned "error" as the error message. now it properly returns the system error string.
bugfix: the tcp cosocket object might automatically re-connect to the remote after it connected successfully in a single run (that is, no EAGAIN returned in the middle) and DNS domain names were used.
feature: implemented the UDP cosocket API, ngx.socket.udp().