this Lua library implements a simple nonblocking mutex lock API based on Lua Nginx Module's shared memory dictionaries. Mostly useful for eliminating "dog-pile effects" and etc. thanks Sri Rao for the suggestion.
feature: added new redis commands bitcount, bitop, client, dump, hincrbyfloat, incrbyfloat, migrate, pexpire, pexpireat, psetex, pubsub, pttl, restore, and time. thanks alex-yam for the patch.
optimize: eliminated the table.insert() calls because they are slower than tb[#tb + 1] = val. thanks alex-yam for the patch. this gives 1.9% speed up for trivial set and get examples when LuaJIT 2.0.2 is used and 4.9% speed up when LuaJIT's v2.1 git branch is used.
refactor: avoided using Lua 5.1's module() function for defining our Lua modules because it has bad side effects.
docs: do not use 0 (i.e., unlimited) max idle time in the set_keepalive() call in the code sample.
docs: added code samples for the redis commands hmget and hmset. this has already become a FAQ.
feature: added support for raw downstream cosocket via the ngx.req.socket(true) API, upon which http upgrading protocols like WebSocket can be implemented with pure Lua (see Lua Resty Web Socket Library). This API can also be used to bypass the Nginx output filters and emit raw HTTP response headers and/or HTTP response bodies. thanks Hendrik Schumacher and aviramc.
bugfix: memory invalid reads might happen when ngx.flush(true) was used: the "ctx" struct could get freed in the middle of processing and we should save the state explicitly on the C stack.
bugfix: the standard Lua coroutine API was not available in the context of init_by_lua* and threw out the "no request found" error. thanks Wolf Tivy for the report.
bugfix: massive compatibility fixes for the Microsoft Visual C++ compiler. thanks Edwin Cleton for the report and jinglong for the patch for the LuaJIT/Lua bytecode loader.
bugfix: Lua VM might run out of memory when lua_code_cache is off; now we always enforce a full Lua GC cycle right after unloading most of the loaded Lua modules when the Lua code cache is turned off.
change: raised the "lua_code_cache is off" warning to an alert.
bugfix: tcpsock:receive(0) could hang until new data arrived or the timeout error happened; now it always returns an empty string immediately. this new behaviour diverges from the LuaSocket library though.
feature: added new option "always_forward_body" to ngx.location.capture() and ngx.location.capture_multi(), which controls whether to always forward the parent request's request body to the subrequest (even when the subrequest is not of the POST or PUT request method). thanks Matthieu Tourne for the request.
feature: now timeout errors in tcpsock:receive() and tcpsock:receiveuntil() no longer automatically close the current cosocket object (for both upstream and downstream connections). thanks Aviram Cohen for the original patch.
bugfix: we did not escape \0, \z, \t, and \b properly in ngx.quote_sql_str(). thanks Siddon Tang for the report.
bugfix: Lua backtrace dumps upon uncaught Lua exceptions did not work with the standard Lua 5.1 interpreter when the backtrace was deeper than 22 levels.
change: now we just dump the top 22 levels in the backtrace for uncaught Lua exceptions for the sake of simplicity.
change: we now limit the number of nested coroutines in the backtrace dump for uncaught Lua exceptions by 5.
optimize: grouped the Lua string concatenation operations when constructing the backtrace string for uncaught Lua exceptions.
feature: now we return all the answer records even when the DNS server returns a non-zero error code, in which case the error code and error string are now set as the "errcode" and "errstr" fields in the Lua table returned. thanks Matthieu Tourne for requesting this.
See ChangeLog 1.4.1 for change log for OpenResty 1.4.1.x.