mirror of
https://github.com/bunkerity/bunkerized-nginx
synced 2023-12-13 21:30:18 +01:00
3096 commits
Author | SHA1 | Message | Date | |
---|---|---|---|---|
dependabot[bot]
|
e302578ea4
|
deps/terraform: bump scaleway/scaleway in /tests/terraform
Bumps [scaleway/scaleway](https://github.com/scaleway/terraform-provider-scaleway) from 2.31.0 to 2.34.0. - [Release notes](https://github.com/scaleway/terraform-provider-scaleway/releases) - [Changelog](https://github.com/scaleway/terraform-provider-scaleway/blob/master/CHANGELOG.md) - [Commits](https://github.com/scaleway/terraform-provider-scaleway/compare/v2.31.0...v2.34.0) --- updated-dependencies: - dependency-name: scaleway/scaleway dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> |
||
Théophile Diot
|
aa3fd4edf8
|
Merge pull request #784 from bunkerity/dependabot/github_actions/dev/docker/metadata-action-5.2.0
deps/gha: bump docker/metadata-action from 5.0.0 to 5.2.0 |
||
dependabot[bot]
|
bb41e8597b
|
deps/gha: bump docker/metadata-action from 5.0.0 to 5.2.0
Bumps [docker/metadata-action](https://github.com/docker/metadata-action) from 5.0.0 to 5.2.0.
- [Release notes](https://github.com/docker/metadata-action/releases)
- [Commits](
|
||
Théophile Diot
|
f159b17ee5
|
Add HTML files to linguist-vendored list | ||
Théophile Diot
|
ff9566b495
|
Update Python base image SHA256 | ||
Théophile Diot
|
c439488eab
|
Update bcrypt version to 4.1.1 | ||
Théophile Diot
|
1e1245ff2d
|
Add Python 3.9 setup and install dependencies for codeQL workflow | ||
Théophile Diot
|
f8dc2f8186
|
Fix plugin system link in README.md | ||
Théophile Diot
|
3920ce03d2
|
Fix formatting and remove unused code | ||
fl0ppy-d1sk
|
43c288046a
|
ui - add CORS to wizard check endpoint | ||
fl0ppy-d1sk
|
1e52dd9fb7
|
Merge branch 'ui' into dev | ||
Jordan Blasenhauer
|
53706a75ea | fix print and remove cdn | ||
Théophile Diot
|
afeb5e4541
|
Update wizard back logic and tweak setup.html | ||
Théophile Diot
|
b3e0a9e8c1
|
Update python dependencies | ||
Jordan Blasenhauer
|
c16e954715 | update setup html | ||
Jordan Blasenhauer
|
9917fbd86a |
setup in-page style and image
*base64 font *base64 image *style tag |
||
florian
|
97f9048bd1
|
Merge branch 'dev' of github.com:bunkerity/bunkerweb into dev | ||
florian
|
49b745a2af
|
ui - init work on /setup endpoint on default server | ||
Théophile Diot
|
7778bd1064
|
Merge pull request #769 from bunkerity/dependabot/github_actions/dev/github/codeql-action-2.22.8
deps/gha: bump github/codeql-action from 2.22.7 to 2.22.8 |
||
Jordan Blasenhauer
|
aca4703325 | Merge branch 'dev' into ui | ||
florian
|
68a8f8eb0f
|
Merge branch 'ui' into dev | ||
Théophile Diot
|
834d4568ee
|
Refactor database session handling | ||
dependabot[bot]
|
2ec0c7e391
|
deps/gha: bump github/codeql-action from 2.22.7 to 2.22.8
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.22.7 to 2.22.8.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](
|
||
Théophile Diot
|
3269e7ec54
|
Fix missing admin_password_check validation in
setup form |
||
Théophile Diot
|
ddb3daae38
|
Merge commit 'dead40ec6d1b5907f2803a6bb55f006dd27203ba' into dev | ||
Théophile Diot
|
dead40ec6d |
Squashed 'src/deps/src/lua-resty-openssl/' changes from 89195843c..5aba923e7
5aba923e7 release: 1.0.2 c659347b3 fix(jwk) fix EC key dump parameters (#131) git-subtree-dir: src/deps/src/lua-resty-openssl git-subtree-split: 5aba923e78ae0f213f3b4719effa879e3971821f |
||
Théophile Diot
|
0142ba1d2e
|
Update lua-resty-openssl version to v1.0.2 | ||
Théophile Diot
|
97a78650ec
|
Update dependencies versions | ||
Théophile Diot
|
10e5dc4f45
|
Merge pull request #766 from bunkerity/dependabot/github_actions/dev/docker/build-push-action-5.1.0
deps/gha: bump docker/build-push-action from 5.0.0 to 5.1.0 |
||
Théophile Diot
|
18aab10dfe
|
Update Firefox installation in Linux workflows | ||
Théophile Diot
|
b8145f3f28
|
Add website link to README.md | ||
Jordan Blasenhauer
|
f92e327577 | add confirm password | ||
Jordan Blasenhauer
|
cdd436bf8a | add reverse proxy inp setup | ||
Jordan Blasenhauer
|
4fe52d0f05 | Merge branch 'dev' into ui | ||
Théophile Diot
|
efaaf454ef
|
Add conditional block for open file cache
configuration |
||
dependabot[bot]
|
3a1b779b56
|
deps/gha: bump docker/build-push-action from 5.0.0 to 5.1.0
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 5.0.0 to 5.1.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](
|
||
Jordan Blasenhauer
|
76c848ed4c | add server name input | ||
fl0ppy-d1sk
|
57b0787dc1
|
ci/cd - add more logs when k8s fails | ||
Théophile Diot
|
b4d790aad5
|
Create web UI wizard functionality (backside) | ||
Théophile Diot
|
2964669d90
|
Merge pull request #764 from bunkerity/dev
Merge branch "dev" into branch "ui" |
||
Théophile Diot
|
eb160334fb
|
Merge commit 'f7bc0d87200a0ec786c88091530734f265a6a8c2' into dev | ||
Théophile Diot
|
f7bc0d8720 |
Squashed 'src/deps/src/lua-nginx-module/' changes from 11ab5315b..c47084b5d
c47084b5d bumped version to 0.10.25. 6d0a2c184 bugfix: used after free when encountering invalid http IF-Match header. 6e9948dcd bugfix: ssl_client_hello_by_lua generating chunk cache key and chunk name 68acad14e bumped the lua version to 0.10.24. ec6df3249 bugfix: windows also need to support ngx_http_lua_ffi_worker_pids. 9bee7e789 bugfix : comparison of integer expressions of different signedness. 1953052a0 bugfix: fixed warning of signed and unsigned. 74786af95 bugfix: windows does not support ngx_http_lua_ffi_worker_pids. ce30e2fb0 Revert "bugfix: doesn't set flags for Darwin arm64. (#2071)" (#2163) 644b98faa feature: introduced ngx_http_lua_get_lua_http10_buffering. 6f7a9a330 feature: add four new apis to manipulate the coctx. 14be60380 doc: setoption is already available now. 6dbc4e1bd tests: use the specified perl to execute cpanm. (#2157) 5e05fa3ad tests: cross requests cosocket can only be use one time. a6ee03aba bugfix: cleanup of http request will not be callled for the request created by ngx_http_lua_create_fake_request. 992bfc352 style: use forward declaration. 1a4859924 bumped the lua version to 0.10.23. 47f0a3676 bugfix: cosocket did not exit when worker_shutdown_timeout handler is called. 81bc96401 tests: fixed some test cases in t/129-ssl-socket.t t/162-socket-tls-handshake.t t/186-cosocket-busy-bufs.t. f488965b8 feature: added HTTP 3.0 support to ngx.req.http_version(). 3f4005fa8 bugfix: fix receiveuntil rest bytes count. 4045ea8eb tests: test failed when running in randmonize mode. 6e3b1c4fd bugfix: define busy_bufs per cosocket (#2119) 56347d174 tests: upgrade openssl to 1.1.1s. (#2117) 0499e8443 doc: add link to pre-defined Nginx variables (#2116) a31e9cf33 bugfix: avoid buf double free in ngx.print if lua body filter enabled (#2115) eb977111b bugfix: add a timed recycling child process as a last resort. (#2112) b754786bb feature: add new ffi api ngx_http_lua_ffi_msec. (#2108) 3207da152 chore: add assertion to make linter happy (#2107) a318d250f doc: add detail on explanation of a running timer (#2105) 4bbb57aa4 doc: add release description for ngx.worker.pids(). (#2104) d518adcac Merge tag 0.10.22 into master. 8d9032298 bumped the lua version to 0.10.22. 4add94239 bugfix: did not wakeup coroutine when worker thread finished. cff86dd7f doc: fix the version in README (#2089) edfa0f984 feat: add ngx_http_lua_ffi_worker_pids to get all workers pid map 3e2a7f459 bugfix: run_worker_thread arg is self-reference. eb6d6cbf0 tests: build with DDEBUG=1. (#2084) 5eb7101d3 doc: complete md5.lua example in run_worker_thread api (#2085) a7e67a596 doc: add more explanation for premature in ngx.timer.at. 73f2b3f6f bugfix: typo in the debug message. (#2081) 9b7bde2e7 feature: added new API bind. 44486a45f feature: add shdict APIs into worker thread (#2074) 99b29cd16 doc: clarify the ngx.req.set_uri_args api when using Lua table as the 'arg' argument. (#2073) 1fd1e83c8 bugfix: doesn't set flags for Darwin arm64. (#2071) 1c43f1c4f ci: bumped OpenSSL to 1.1.1p. (#2070) 74b8d4b4f chore: update the PR types (#2069) c55fceb5c ci: add a way to check PR title automatically (#2067) b6d167cf1 bugfix: update handling of multiple headers changed in nginx 1.23.0 (#2063) c8597eda0 tests: change the running phase to cover the bug reported in google group. (#2064) 9a0a8968c bugfix: did not wakeup coroutine when worker thread finished. 3fe8d9dde change: can not receive udp datagram greater 8192. (#2057) 2c60e8966 optimize: destroy pipe proc when freeing the request. (#2052) e7660d75a doc: revised English grammar in ngx_http_lua_timer.c. (#2053) 9c6478b08 Merge branch '0.10.21.x' 0ac2ab279 bugfix: tctx.pool is double freed. (#2049) b6db2e741 optimize: add error log when closing the pipe failed. (#2050) b91221bd6 optimize: fix potential null pointer dereference found by coverity (#2051) 381e9b3a6 bugfix: wrong memory size for the pernding timers array. (#2048) af130ae89 fix dead code found by coverity 8a8e710cb fix potential null pointer dereference found by Coverity (#2043) 86e1a6446 feature: content_by_lua_file return 503 if read err and file is existed #1992 (#1995) 653d6a36f bugfix: Apple Silicon FFI ABI limitation workaround bc2ecdae2 ci: add util/build-without-ssl.sh. (#2035) f0c04dbf6 bugfix: failed to compile when nginx https is disabled. (#2034) 6c0cc5c45 doc: did not generate README.markdown from doc/HttpLuaModule.wiki. (#2029) c1d378824 feature: add `server_rewrite_by_lua*`. (#2004) 3d1431790 travis: update openssl to 1.1.1n. (#2028) 8df296c47 travis: fixe the uri of lua-resty-core. 2b902657f cosocket: add function `tcpsock:setclientcert`, reimplemented `tcpsock:sslhandshake` with FFI 1fea11712 tests: use random port numbers instead of fixed port number to prevent conflict. (#2025) a7444abe8 tests: 160-disable-init-by-lua.t: prevent the test process from overwriting the original pid file. (#2024) 247086ed3 doc: describe the second argument of get_uri_args (#2023) d959374e0 optimize: use ngx_hash_t to optimize the built-in header look-up process for ngx.header.HEADER. 974d5d163 feature: add FFI implementation for ngx.arg getter (#2021) bd92edf3b doc: modify openssl patch requirements. (#2022) 496d98533 tests: change the count of the record after adding ngx.get_raw_phase. (#2019) 97d1b704d bugfix: ngx.pipe waits until timeout because child process forgot to close pipe after dup2. d001dea77 bugfix: posted event handler was called after event memory was freed. (#1982) 7d585bd53 bugfix: fixed size of the array when initialized in the init_worker_by* phase. (#2017) 66294b9d0 bugfix: ambiguous error message 'connection in dubious state' when connection is closed. (#2016) 77540f78c doc: change description for ssl_client_hello_by_lua. cee06592f doc: fixed link to lua-resty-core 15b693b33 bugfix: passing the wrong chunkname argument to luaL_loadbuffer. (#2010) 70a50e66c optimize: change lua chunkname to config filename and line number for (init/header_filter/body_filter)_by_lua_block and so on. (#2008) 907d1d9ad doc: modified the todo section. we now have exit_worker_by_lua (#2009) 297e73cde bugfix: the error message should use the first line rather than the last line of the code block when load lua code block failed. (#2005) 2615bafa3 bugfix: segment fault when get header via ngx.req.raw_header with malformed requests. 8cf9c632d travis-ci: upgraded openssl to 1.1.1m, pcre to 8.45. (#2002) 8b497f5a5 change: delete useless code for get old_cpath. (#2000) ce8405c73 bugfix: ngx.run_worker_thread injected api into the wrong table.(#1996) fa5982c63 tests: t/140-ssl-c-api.t failed because got wrong libssl.so. a41fdcea4 feature: add api to fetch raw nginx ssl pointer of the downstream request. 5f02311a9 feature: ssl/tls: support for passphrase protected key. (#1991) 7eb8ad025 bugfix: ngx.pipe waits until timeout because child process forgot to close pipe after dup2. 30debf674 doc: mentioned OpenResty. 320f03078 doc:move all the discouraged *_by_lua documentation to *_by_lua_block 1637b3534 tests: travis.yml: ngx-releng depends on ack. (#1986) f36fe2982 feature: expose the 'Last-Modified' response header as ngx.header["Last-Modified"]. (#1983) 75c68b225 bugfix: posted event handler was called after event memory was freed. (#1982) de09fc6cc tests: removed duplicated c declaration in t/140-ssl-c-api.t. 2fce8ca38 optimize: don't calculate hash when clearing the request header. 85388f4ef feature: check the number of parameters for ngx.thread.wait d0e56ca14 optimize: don't calculate hash when clearing the header. a27647626 change: use nil instead of false when lpush&rpush overflow. Co-authered-by: lijunlong<lijunlong@openresty.com> b67b22af8 feature: prevent calling ngx.exit() with invalid values. 0b6da3b6c feature: added ffi-based function 'ngx_http_lua_ffi_req_is_internal'. e98f5c508 doc: Clarify ngx.req.set_header usage for proxies. 5483b9157 feature: added http const HTTP_NOT_IMPLEMENTED, fixes #1466. Co-authored-by: lijunlong <lijunllong@openrestycom> 37ec9f756 doc: Readme: completed the Installation part, with add lua-resty-core and lua-resty-lrucache. 94fa662bc style: removed extra space. (#1981) 6302d4740 tests: NGINX_TEST_CHECK_LEAK detects memoryleak because nginx can not free resolver ctx quickly. This was introduce in commit acd53645754ce which is use to resovle double free of resolver ctx. This issue happens only when nginx can not get any reply from the dns server until timeout. 94dd3ac94 style: updated the indentation of .travis.yml according to the yaml specification. (#1976) 3229945a2 bugfix: prevent illegal memory access in ngx_http_lua_util.c. (#1974) ce8fd0268 tests: fixed test plan for 129-ssl-socket.t and 162-exit-worker.t. (#1972) 0b98a58ad tests: 132-lua-blocks.t and 158-global-var.t: use RegExp instead of strict character match. (#1971) 91907a0f3 bugfix: forgot to clean up the cached thread contexts when worker process exits. (#1968) 892ed514f tests: skip test cases for unsupported event types. (#1967) 9a93a3a0b travis-ci: bumped the NGINX core to 1.21.4. (#1964) 9e692e29c travis-ci: updated ftp.pcre.org to sourceforge mirror. (#1965) e68213328 tests: wrong pid path when running jobs greater than 1. (#1961) 751667913 style: changed the comment a bit. 931f62799 bugfix: ngx_http_lua_assert failure in ngx_http_lua_worker_thread.c. (#1960) 3f33dd862 optimization: removed superfluous code from shdict_store. (#1956) 560461e1f tests: updated the test cases in t/104-req-raw-header.t to reflect the changes in nginx. 913b5583b tests: updated the test cases in t/020-subrequest.t to reflect the changes in nginx. 0dffd1227 travis-ci: bumped the NGINX core to 1.21.3. 73181ca90 bumped the API version to 0.10.21. 617cb5dad style: removed extra space. (#1952) 557e0097d tests: remove workflows/label.yml since it is not working properly. (#1950) 59d39ca2f doc: fixed spelling errors in the docs and code. (#1947) ccc748eaf bugfix: fix nginx crash caused by a bad format specifier. a6e9e11f1 doc: fixed code style and test case style found by ngx-releng. aeaecd652 tests: added the missing test case which should be added in commit 5f47838e600. 5f47838e6 doc: clearify the missing the closing long bracket may due to the lua code is too long. 3f1c6834e bugfix: fixed memcpy param overlap detected by asan. c4d5ae71e feature: allowed some ngx APIs to be used in worker thread. 421a8da81 chore: fix possible null pointer dereference found by Coverity. c4a3e34fc bugfix: we should use luaL_typename() with lua stack index. 07e11f316 SSL: fixed potential leak on memory allocation errors. similar to https://hg.nginx.org/nginx/rev/8981dbb12254 If ngx_pool_cleanup_add() fails, we have to clean just created SSL context manually, thus appropriate call added. 7c60431a0 tests: travis failed due to the cetificat of Let's Encrypt expired. (#1939) acd536457 bugfix: nginx crash when resolve an not exist domain in thread create by ngx.thread.spawn.(#1931) c4ca52032 tests: ca-certificates of Let's Encrypt has expired. (#1937) 1ea5b09f1 feature: auto assign pr to project (#1772) 250f31d01 tests: the certificate of the Let's Encrypt has expired. (#1929) a3ec1565e bugfix: should reset the value_len to 0 when reuse the expired list type key in shared dict. (#1928) 5095da4a5 change: do not need to create the Lua request ctx data table from C (#1926) 5425d6d8e bugfix: we should ignore match limit in DFA mode. (#1924) fef25815f feature: implemented the ssl_client_hello_by_lua_block and ssl_client_hello_by_lua_file directives for controlling the NGINX downstream SSL handshake dynamically with Lua. 776f82910 style: fixed some of the code style issues and add code style checking for the ci. (#1916) 3820d0e11 bugfix: buffer bloat and CPU 100% when download large file was filtered by body_filter_by_lua. (#1909) 86514c1e4 bugfix: fixed missing 'const' qualifier causing compilation failure on freebsd. (#1914) a9cd21e94 travis-ci: upgraded openssl to 1.1.1l. c297cf69f tests: improve test cases robustness. 89818721f feature: implement the new ngx.run_worker_thread API to run Lua function in a seperated worker thread. 263bd0ca7 bugfix: should not allow to create timer in the exit process phase (#1907) b721656a9 bugfix: add nginx version condition for privileged agent connections. (#1903) 66a4d417d add privileged agent connections 53bd82199 travis-ci: remove clang compiler mode from travis. ccb0f8cc1 change: removed the openssl 1.0.2 in CI since it has been EOL ove a year, fix #1897. (#1899) bdd48a154 bugfix: we didn't exclude the ssl_verify_callback when compiling with LibreSSL (#1894) 223139d20 chore: fix typos introduced by PR #1890 (#1892) 6c1a2e95b bugfix: fixed typo introduced by 276f16af. (#1891) 276f16af4 feature: add lua_ssl_conf_command directive for setting arbitrary Ope… (#1890) f1b97e450 feature: support environ in ngx.pipe on mac (#1882) 6ed8e4b0f feature: allow to be compiled with LibreSSL 3.0+ (#1888) f72792234 doc: stripped line trailing whitespaces. (#1881) 68f6a1498 travis-ci: upgraded openssl from 1.1.1i to 1.1.1k. (#1868) 9007d673e bumped the API version to 0.10.20. dabc8e881 change: changed from graceful shutdown to abort when lua_resume return LUA_ERRMEM. d3a862642 tests: suspected memory leak of 160-disable-init-by-lua.t when test with TEST_NGINX_CHECK_LEAK=1 because forgot to close the file. (#1877) 14ef2cb25 doc: added sample config directives for internal redirects, as reported by Jason Hoch. b8d5b379f tests: added a new rule about 'ngx_pass_open_channel()' to valgrind suppression file. (#1874) dcc77fae7 doc: documented the scope of ngx.ctx for timer handlers. thanks Jason Hoch for the suggestion. 5b90b1fae doc: recommend to renew ngx.timer.at regularly (#1876) a43cc398a doc: sync doc from README to ensure wiki2markdown.pl is work (#1875) 1c1bcfeb9 travis-ci: bumped the NGINX core to 1.19.9. (#1870) eb944dedd bugfix: correct the way to handle invalid quote in ngx.escape_uri/ngx.req.get_{uri,post}_args (#1862) 2abb142d2 tests: fixed typo in 162-exit-worker.t. (#1866) 88a52c44a chore: fix possible null pointer dereference found by Coverity (#1846) 9a3176e93 chore: fix possible null pointer dereference found by Coverity (#1844) 4d2d47ce5 chore: fix possible null pointer dereference found by Coverity (#1845) 23e40f3fd docs: fix spelling (#1841) 138c1b964 src/ngx_http_lua_ssl_certby.c: fix possible null pointer dereference found by coverity 7bba6d195 bugfix: fixed memory leak in debug log. 8f12a28e2 updated openssl to 1.1.1i. (#1836) 60e95eff3 doc: added new youtube video on luajit bytecode precompilation. b9b39645f doc: added 1 more video. 99ea68a13 bugfix: we closed listener's fd which was closed. (#1832) d59afff27 doc: added our tutorial videos. 7105adaa5 bumped the API version to 0.10.19. (#1824) 83a61d6b4 optimize: post zombie thread: avoided the linear search. (#1823) 15197e7bb bugfix: accessed memory out of range when calling lua_pushfstring with none zero-terminated string introduced in commit 7367a231. 26809e75b tests: 106-timer.t: fixed test plan count. 98f482bfb bugfix: process may crash when a timer run failed and a function with arguments run inside this timer. (#1819) e497ffc68 bugfix: ngx.resp.set_headers(): may cause an error when Content-Length field is larger than 2^32. 411a9aed7 tests: 124-init-worker.t: made the test robust by changing the match pattern for TEST 22. (#1817) 4653f2182 bugfix: fixed segfault caused by an incorrect format token introduced in commit 3e24a95a. 65d875074 bugfix: wrong pipelined request body length when request body is parent's request body. (#1814) 8b9d7fdae travis: openssl: enable threads. 50de32e85 travis: upgraded openssl 1.1.1 to 1.1.1h. 843e20301 bugfix: ngx.flush never blocks on http v2. ea6b07cd6 feature: implemented the new tcpsok:setoption() function for setting options for the TCP socket. 8ae3e73f2 tests: --- shutdown_error_log should be excluded from repeat_each() when counting plans. 7bccbbff6 tests: skip t/163-signal.t under hup reload test mode. de1c3c63b bugfix: entry threads would leak when exceeding the lua_max_running_timers limit. this regression had appeared in commit 4de59f5da or v0.10.18rc2. e16d217a1 optimize: removed useless code for luajit without the lua_resetthread API. 186c84738 debug: added more debug info to monitor the main lua stack size in timer creation code. fdf752daf feature: added undocumented API for attaching arbitrary key-value pair data to a cosocket TCP connecton, which can survive connection pool reuse. 7367a2314 bugfix: ngx.resp.get_headers(): may return a wrong (like: negative) value of the Content-Length field when it is larger than 2^32. 57ebdd343 bugfix: should still use timer instead of delayed_events when worker process is exiting, otherwise the new created 0 delay timer may have no chance to run. ff8163423 optimize: added the "ev" to ngx_posted_delayed_events instead of the rbtree for 0 delay timer, so that we can save an epoll wait in such case. df4033d13 travis-ci: bumped the NGINX core to 1.19.2. (#1793) 0bccfb30f style: added "static" for the "ngx_http_lua_module_ctx" (#1794) 2c5b18933 feature: implemented the new ngx.ssl.server_port() API to get server port. d8b408a7f bugfix: build error with nginx 1.7.4 or older version 2d82f078a bugfix: we now only recycle light threads which are "entry threads" otherwise it is not safe to recycle user created threads since we have no idea whether the user may still hold refs to them. b28112130 optimize: now we make use of the new lua_getexdata2 and lua_setexdata2 to attach coctx to the Lua thread objects directly which save the lookup overhead which can become the bottleneck when there are many Lua light threads around in a single request handler. 021b75b88 travis: fixed the luajit branch. 4de59f5da feature: now we recycle lua thread GC objects for our "light threads" and added lua_thread_cache_max_entries directive to configure the cache size. 4695419bd bumped the API version to 0.10.18. ce30a0886 feature: added new C API ngx_http_lua_pcre_version to wrap the pcre_version() C API in libpcre. ef9e7507a updated .gitignore a bit. ac9836f97 bugfix: double values larger than int32_t were incorrectly printed out as 64-bit integers. 85fb9b839 test: make the 030-uri-args.t more robust since there is no fixed order in lua table. (#1797) 4d2a04a08 test: increased time unit to make test less error-prone db1999816 bugfix: the format in argerror messages are incorrect (#1787) 97b91899c bugfix: when recreating balancer buffer, remove existing buffers first (#1770) 172c2145e doc: fixed broken links. 9416eadfa doc: minor link tweaks. b1a3b5d16 style: removed a line-trailing space found by ngx-releng. 2db0e8246 doc: minor link tweaks. b4f464a90 doc: added a link to new blog post "Introduction to Lua-Land CPU Flame Graphs". e86d41f50 bugfix: added missing SSL feature macro (#1776) 218af5ee9 feature: shared ngx.ctx among SSL_* phases and the following phases. (#1514) d6a29d261 feature(socket.tcp): enhance the logic of parameter verification in connect 21cfd8ab2 doc: ported recent changes in mardkown to the wiki file. b0875fa8f doc: added more blog post links. 3e24a95a2 bugfix: the body size may overflow since the size_t is only int32 in 32-bit system (#1756) eeee4069e doc: ngx.var.VARIABLE is available in the balancer_by_lua* context (#1761) 49937fb69 doc: removed the useless semicolon in the example lua code 83bfe9157 doc: added a blog post link. f6b486b24 doc: fixed the wrong phase for lua_need_request_body (#1758) bdfc4bfc0 doc: removed the useless semicolon in the example lua code (#1757) e526caeeb feature: added the `ngx_http_lua_ffi_balancer_recreate_request` FFI function to allow recreation of request buffer in balancer phase. (#1734) c0e460a53 feature: add FFI interface to verify SSL client certificate (#1666) fd2547491 test: use official repo instead of third pard repo 393c95470 feature: added exit_worker_by* to run Lua code upon nginx worker process exit. (#1682) 1669904d5 * optimize: avoided use of lua_tolstring in ngx_http_lua_calc_strlen_in_table, ngx_http_lua_copy_str_in_table, ngx_http_lua_socket_udp_send, log_wrapper and ngx_http_lua_ngx_echo. b050e1c94 sytle: added blank line after code block. (#1752) af7484201 test: fix: add lua-resty-string to lua_package_path (#1748) 4368a8ea2 bugfix: macro contains operator should be wrapped inside a bracket. 635b6e864 feature: supported receiveany on ngx.req.socket(true?) socks (#1623) a4d63f7f7 refactor: used 'yieldable context' to simpify the context list. c366f3a9b doc: fixed an unclosed <code> tag breaking the markup. c48eeed50 tests: 161-load-resty-core.t: added vim mode line. 2d23bc4f0 bumped version to 0.10.17. 9ab38e8ee bugfix: prevented request smuggling in the ngx.location.capture API. 6913b1b1e doc: updated the Version section to reflect the release date. c2565fe79 tests: added test cases for sending HUP signal to nginx processes without the master process. aa548f538 tests: fixed an error message to reflect new changes in lua-resty-core. bb045f2d8 feature: ngx.escape_uri: added new optional 'type' argument not_component argument for pure URI escaping (still defauls to URI component escaping). 5d1517268 feature: ngx.req.set_uri(): added the 'binary' optional boolean arg to allow arbitrary binary data in the unencoded URI. 8746f6405 doc: ngx.req.set_uri_args: fixed byte ranges for automatic escaping. e1e335fd7 security: ngx.req.set_header(): now we always escape bytes in header names and header values which are prohibited by RFC 7230. be3531827 doc: more typo fixes. 2a6c9a63e doc: minor typo fixes. c6ffcfbf3 tests: added test cases for the nginx core patch static_mod_escape_loc_hdr. 785fb5709 feature: ngx.req.set_uri_args() now automatically escapes control and whitespace characters if the query-string is provided directly. 99a5a6bcb test: used the iptable -I option to insert rule to the head of the filter chain. f655b0e19 feature: add mergify.yml to manage our pr c86819f0b doc: updated the docs on the limits of subrequests to reflect recent changes in the nginx core. 8ac6cc728 doc: made the code examples more realistic (better for direct copy&paste use). d278043fb doc: added docs for working around memory fragmentation issues to the shdict:set() method. 23d2bc10a bugfix: ngx.req.set_uri_args() threw an exception with wrong argument info. 678988696 bugfix: set_by_lua_block allowed more than one arg (in addition to the block). 8c9968bd4 doc: fixed a few typos/wording issues in readme. (#1712) febd73006 travis-ci: bumped OpenSSL to 1.1.1g. 50c1912ef misc: ngx_http_lua_logby.c: removed duplicate headers. 6e48a804f style: ngx_http_lua_socket_tcp.c: ensured two blank lines between functions. 896638287 style: fixed a minor styling issue in 'ngx_http_lua_initworkerby.c'. efd284106 travis-ci: bumped OpenSSL to 1.1.1f and fixed older versions downloads. beb5c6ba0 bugfix: allow the use of spaces in 'ngx.req.set_uri()'. 6d270c32f doc: fixed the return value name in 'ngx.worker.id()' documentation. 66026039d doc: clarify ngx.timer.every callback argument conventions, #1409. f991f3e10 travis: fixed the warnings from build config validation. f45d4e999 bugfix: overrided the input header only for the first time f6ff2890c misc: avoided warnings with old gcc versions due to incorrect inline definition and renamed functions for clarity. 3908769d3 travis: upgraded pcre to 8.44. ada56de57 updated .gitignore. 79b3bd3cf config: more followup fixes in autoconf feature tests. 3a37c9c61 bugfix: FFI availability feature test was broken on Windows. 38f587a35 bugfix: ensured arguments of APIs mutating uri or request/response headers do not contain unsafe characters. (#1654) be864c2af travis-ci: upgraded OpenSSL to 1.1.1e. 43220429e tests: fixed numbering thanks to the reindex script. ec3b219e6 tests: fixed a newly failing test due to changes in openresty.org accepted ciphers. 4c4bb0fcb bugfix: fixed use of uninitialized cache_key in ngx_http_set_by_lua_file. 52f0d95fa doc: sync the minor change (in the last commit) to README.markdown from the HttpLuaModule.wiki file. 6b79cd441 doc: minor grammar typo fix (#1642) (#1643) 9259e7a34 tests: 139-ssl-cert-by.t: relaxed timing test cases for tvw test mode. 8669e0985 bugfix: ngx.pipe: ensured reading while a process died returns the "closed" error. 743773bfb tests: fixed a newly failing test due to openresty.org now rejecting TLSv1 connections. 1d9298d64 bugfix: fixed use of an uninitialized value in ngx_http_lua_set_by_lua_file. 028c0d495 doc: mentioned that 1.17.8 is the latest NGINX core version tested. c06793c3e travis-ci: bumped the NGINX core to 1.17.8. d328e5620 tests: 025-codecache.t: updated a test case to avoid error logs in stderr. c2390abb5 Revert "bugfix: ensured 'init_worker_by_lua*' does not mutate another NGINX module's main_conf." e32864543 change: we now ignore 'lua_regex_*' directives when NGINX is compiled without PCRE support. 8f518e7d9 travis-ci: bumped OpenSSL to 1.0.2u. 760f7073d feature: implemented the FFI interface for the 'ngx_req.add_header()' API. 7c5b11d73 tests: 124-init-worker.t: fixed a few failing test cases. a3ac3f557 style: updated 'nginx_version' guard macros assuming it is always defined. 771eb231e misc: ngx_http_lua_util.h: removed 'ngx_str_set' definition as it is defined in NGINX 1.6.0+ d1e55394e misc: removed dead code, guard non-OpenResty LuaJIT definitions, and fixed styling issues. 478bae6fc doc: readme: mentioned that the latest tested NGINX core is 1.17.4. 4e593c335 travis-ci: bumped the NGINX core to 1.17.4. 69780f676 bugfix: config: fallback to '--undefined' option for ld 2.25 and below. d062170e9 feature: implemented the 'ngx.crc32_short' and 'ngx.crc32_long' C FFI APIs. 50dabbc3a travis-ci: bumped OpenSSL versions to 1.0.2t, 1.1.0l, and 1.1.1d. fd1e0f89e feat: config: added a check for Lua language version 5.1. 9b224957f doc: readme: minor updates to align with the ngx_stream_lua module README. 4c943b944 tests: 087-udp-socket.t: removed a duplicated test case. 70484bcbe tweaks: ported adjustments and missing test cases from the ngx_stream_lua module. 315330ac0 bugfix: config: ensured LuaJIT FFI check and static PCRE builds succeed on all platforms. 2a190736a change: removed error logging on coroutine runtime errors. 9a892b8d5 bugfix: coroutine.wrap: propagate errors to the parent coroutine. c658e2260 tests: 139-ssl-cert.t: added test cases asserting support for 'ngx.thread.kill()' and 'ngx.socket.udp' in 'ssl_certificate_by_lua*'. 97f0101e5 feature: enabled the 'ngx.thread' and 'ngx.socket.udp' APIs in ssl_session_fetch_by_lua*. 97431d814 bugfix: fixed compilation with NGINX cores < 1.11.11 189ba24ef feature: when a timer fails to run we now log the location of its function's definition. 4b9e53f74 feature: ngx.pipe: allowed for calling resty.core 'ngx_pipe.shutdown()' on a sub-process when a light thread is waiting on it. 8573c1c5d feature: ngx.pipe: allowed for specifying timeouts in resty.core 'ngx_pipe.spawn()'. d154e5a7c doc: readme: removed all mentions of PUC-Rio Lua and fixed styling and grammatical issues. c5135a051 change: removed compatibility code for unsupported NGINX versions (< 1.6.0). 947fa0088 change: retired the old CFunction API when newer FFI implementations are available. 60736e686 change: 'resty.core' is now mandatorily loaded, and the 'lua_load_resty_core' directive is deprecated. a96e99ab1 change: we now prevent compilation with PUC-Rio Lua; only LuaJIT 2.x is supported. 2f270642b bugfix: fixed file cache key size allocation. 6b3822b18 bugfix: added missing arguments to an 'ngx_log_error()' call in ngx_http_lua_pipe.c. 9fa316f50 tweak: updated the debug log in 'ngx_http_lua_socket_tcp_conn_op_ctx_cleanup()' to align with the meta_lua module. ba182dd59 style: fixed some minor styling issues to align with the meta_lua module. eed28fca8 optimize: fixed the pre-allocated number of keys in the 'ngx.socket.tcp' table. 6c25b7bea optimize: removed declaration of obsolete 'ngx_http_lua_inject_logby_ngx_api' function. d313bf8de bugfix: ensured the 'pcre_version' symbol is also preserved on Darwin platforms. c618d0d23 bugfix: fixed compilation errors encountered with ngx_stream_lua due to a recent commit. 881bf91da bugfix: ensured arguments of APIs mutating response headers do not contain '\r' and '\n' characters. 246ec8ac4 refactor: simplified Lua chunk and file cache key generation. f45908cd3 refactor: reduced cache key size by removing unnecessary chunkname component. bd83c656d tests: codecache.t: moved and reinforced a test case ensuring *by_lua directives with identical Lua chunks produce distinct cache keys. 0c755ed89 bugfix: ensured set_by_lua_file with nginx variables re-computes closures code cache key. 39c2ead3c optimize: improved code cache lookup performance by using 'luaL_ref()' to avoid the costly 'lj_str_new()'. bf11f67d8 tests: codecache.t: added tests for code cache behavior with *_by_lua_file directives containing NGINX variables. e42f9b5f6 doc: updated the section on OpenSSL and NGINX patches in the 'ssl_certificate_by_lua*' documentation. 09484e8fd bugfix: ensured 'init_worker_by_lua*' does not mutate another NGINX module's main_conf. b6875300b doc: mentioned that we support NGINX 1.17.x. cf77a42c4 doc: removed TODO items that have been taken care of. de60e555a travis: added OpenSSL 1.1.1c to the tests matrix. 467f0134d tests: added tests asserting that 'ssl_certificate_by_lua*' and 'ssl_session_fetch_by_lua*' can yield when reading early data. d3dbc0c81 bugfix: skipped 'ssl_session_store_by_lua*' and 'ssl_session_fetch_by_lua*' when using TLS 1.3. 2014dd80f bugfix: ensured the 'pcre_version' symbol is preserved as undefined when PCRE is statically linked. 277d382f5 api: bumped API version to 0.10.16. 2524330e5 travis-ci: bumped the NGINX core version to 1.17.1. 65bdd4a83 tests: 139-ssl-cert-by.t: downgraded error log level of SSL handshake failures from 'crit' to 'info'. 4e974ba96 doc: updated ssl_session_fetch_by_lua_block documentation around OpenSSL and NGINX core patches. b0c737391 Revert "feature: added OpenSSL 1.1.1 support to ssl_session_fetch_by_lua*." 81344434a doc: fixed a mistake in ngx.location.capture() example in README.md. 32dd6a34a style: fixed a minor alignment issue in ngx_http_lua_ssl_certby.c. 59b6430f7 bugfix: LuaJIT sets currentline to -1 if it is unavailable. a38d90667 feature: added OpenSSL 1.1.1 support to ssl_session_fetch_by_lua*. 3a5872969 travis-ci: bumped OpenSSL to 1.0.2s and 1.1.0k. 33a5517c9 tweak: fixed some warnings from the clang static code analyzer. 4102b82cd tests: 161-load-resty-core.t: added a test asserting the directive honors 'lua_package_path'. 1882c30a0 doc: we now work with nginx 1.14.x and 1.15.x. a7afd56c6 feature: added support for specifying environment variables in ngx.pipe spawn() FFI API. 1c756b385 doc: fixed a mistake in tcpsock:receiveany() example in README.md. 30678fd5b tests: ssl-socket.t: fixed a failing test case due to openresty.org's default cipher. 441c7f626 tests: re-enabled a test case for using ngx.re.match in init_by_lua*. 28cf5ce3b feature: added the FFI API for 'str_replace_char()'. f87d1f165 bugfix: ngx.pipe: cleared the pending event after aborting the uthread. 86941a706 tests: 123-lua-path.t: fixed a few test cases failing in EC2 to-ngx_lua suite. 7be0a4dc9 doc: fixed a typo in README.md. 61e4d0aac tests: fixed a few failing test cases due to loading resty.core. fccf383ae tests: fixed default lua path to load resty.core from many test cases. 87f0a09a6 feat: implemented the lua_load_resty_core directive which loads resty.core by default. 7ac6f3f67 doc: fixed a typo in a comment from ngx_http_lua_common.h. 95a2e59bf tests: removed obsolete drizzle upstream block in init.t. 12d991e18 api: bumped API version to 0.10.15. afeeb84b0 bugfix: ngx.pipe: fixed a segfault when error_log is configured with syslog. 2bc20ccb0 travis-ci: switch to xenial image 15b01c66f tests: fixed the tests using iscribblet.org which would time out now. a92cf7255 tests: fixed failures due to recent CDN changes. 83ca6b57a doc: bumped version to 0.10.14. ee47e55eb bugfix: ngx.pipe: proc:wait() returns false only when the sub-process exited abnormally. c368af2f0 tests: 159-sa-restart.t: avoided sending SIGWINCH to the test nginx worker process. 761ddca72 bugfix: ensured we cleanup up aborted queued connect operations. 8edb21abc bugfix: only update connections count when cosockets are truly associated with the socket pool. fd90f4e82 doc: one followup tweak. 4ebab2b8a doc: emphasized that this module is a core component of OpenResty. cf887654a tests: switched to 127.0.0.2 instead of agentzh.org for timeout-related tests. 01735c27f tests: hardened a few flaky test cases from recent CI runs. 70dd0bee4 tests: fixed a test case in 068-socket-keepalive.t which always fails when a local dns server is running. 9750a8173 tests: fixed new test failure due to openresty.org server changes. b2af4d369 bugfix: inlined Lua code snippets in nginx.conf failed to use the Lua source checksum as part of the Lua code cache key. thanks Oleg A. Mamontov for the report in #1428. f627f4c54 tests: t/160-disable-init-by-lua.t: hardened test suite to prevent false positives. 055bb17c6 bugfix: fixed a segfault introduced in 7c2b58e when testing an nginx configuration containing 'lua_shared_dict' directive(s). aef03eb33 feature: added the C API to support the 'ngx.pipe' module provided by lua-resty-core. 2c8984934 travis: bumped the nginx core version to 1.15.8. bd9964e7f tests: fixed some test cases failing with the 1.15.8 nginx core. c2940c132 feature: added backlog queueing to cosocket connection pools. 2fb8f120c feature: added support for the Nginx builtin Link header. 248060b81 feature: errors are now logged when timers fail to run. 7c2b58ee7 change: we now avoid running init_by_lua* in signaller processes and when testing the nginx configuration. e76292dee tests: reindexed the t/158-global-var.t suite. fbb891930 change: we now avoid generating the Content-Type response header when getting all response headers. cec2a09de bugfix: ensured Content-Type header gets generated when other headers get set. 637a4c645 doc: updated the copyright year to 2019. 017e00462 bugfix: we now avoid generating a Content-Type header when getting/setting other response headers. ab2e2718b tests: updated the test suite so that it can be run in parallel mode. 5d924cc63 tests: require: hardened lua_path and lua_cpath regexes. f63af5dc0 travis-ci: upgraded openssl to 1.0.2q and 1.1.0j. 11a31b540 tests: increased the timeouts of some ssl cosocket tests. ec0d5768b doc: noted that ngx.req.get_method can be used in the body_filter_by_lua* and log_by_lua* phases. 60225ad19 bugfix: the lightuserdata mask was broken in WIN64. b4ade7887 bugfix: we now only apply the lightuserdata mask on platforms that are at least 64bits. 1c72f57ce feature: added an FFI API for retrieving env 'directives' values. 2f7c65009 feature: implemented a new 'lua_sa_restart' directive, which sets the SA_RESTART flag on nginx workers signal dispositions. c65f5738a bugfix: the 'dd' calls in ngx_http_lua_util.h are now guarded by '#ifdef DDEBUG' . 3754757be change: we now print an alert when a non openresty-specific version of LuaJIT is detected since many optimizations would be missing. 1a73e0ab7 doc: ported the Lua 5.1 interpreter removal to the wiki document. 08a9baa92 bugfix: ngx.process: process.type() didn't return 'master' in master process. 09a365460 tests: declared many variables as local to avoid triggering the new _G write guard. 5efd95d79 doc: updated the docs to reflect the change that we now no longer support the standard Lua 5.1 interpreter in this module. also recommended OpenResty's LuaJIT branch version instead of the stock LuaJIT. c9eca03eb misc: updated _G write guard message to be more accurate. 84338ab85 typo: fixed a debug log in access and rewrite handlers. ebfa66ceb misc: rename a test file to be properly ordered. d067594ca bugfix: silenced -Wcast-function-type warnings. 728681211 feature: added support for ARM64 (Aarch64). f64ec8c90 bugfix: tcpsock:setkeepalive: worker processes might take too long to gracefully shut down when the keep alive connections take a long max idle time. e94f2e5d6 bugfix: fixed segfault in NGINX core >= 1.15.0 when init_worker_by_lua* is used. 576a10d24 doc: mention that ngx.req.set_body_data() and ngx.req.set_body_file() must read the request body. 8ba33dac0 optimize: removed a duplicated include directive in ngx_http_lua_regex.c. 55743aeba bugfix: when variable is cacheable and indexed, setting the request "Host" header should clear any existing cached $host variable value so that subsequent reads return the expected result. 70b843f82 tests: upgraded openssl version to 1.1.0h. 6bbfffdec tests: we failed to enable master process when configuring multiple workers. 9112536b1 api: bumped API version to 0.10.14. b5ffb11fe feature: implemented the receiveany() upstream cosocket method. 5a3c48d23 doc: fixed the links to ssl_session_store_by_lua_block. 15e93a11e restored the change in commit 4ff3dd14ed since it only changed the auto-generated README.markdown. alas. 612931c0f doc: bumped version to 0.10.13. 0605709c3 bugfix: fixed compatibility regressions on Win32. this regression had appeared in commit 012f3163e. f341daa26 api: bumped API version to 1.10.13. 52af63a5b feature: ngx.req.get_post_args(), ngx.req.get_uri_args(), ngx.req.get_headers(), ngx.resp.get_headers(), and ngx.decode_args() now would return an error string, "truncated", when the input exceeds the max_args/max_headers limits. 19cc6bf8f tests: fixed a test case that cannot be run in parallel test jobs. 4ff3dd14e doc: fix the link to ngx.ocsp's docs. 288ebdb93 doc: bumped version to 0.10.12. 91a0ad236 optimize: switched exptime argument type to 'long' in the shdict FFI API to mitigate potential overflows. 5196e6551 tests: remove google.com relevant ssl certificate test cases. 9ea1c06a6 feature: ngx_http_lua_ffi_set_resp_header(): now add an override flag argument to control whether to override existing resp headers. 53519cd7a feature: allowed sending boolean and nil values in cosockets. 6d4475ae3 tests: increased timeouts to avoid failing in mockagain writing test mode. 809192c96 feature: api.h: exposed the ngx_http_lua_ffi_str_t type for other Nginx C modules. 23e69fb20 bugfix: ngx_http_lua_ffi_ssl_set_serialized_session(): avoided memory leak when calling it repeatly. 5cd103b1f optimize: avoided the string copy in ngx_http_lua_ffi_req_get_method_name(). 80fa32c8d feature: added support for the 308 status code in ngx.redirect(). 439a02ab9 typo: fixed an error message typo in set_der_priv_key(). bb76eb123 change: switched to SSL_version() calls from TLS1_get_version(). feae6e775 doc: mentioned that OpenResty includes its own version of LuaJIT which is specifically optmized and enhanced for OpenResty. 3cde1d8aa doc: fixed some code comment typo. a698cb098 doc: updated the NDK repo URL to github.com/simplresty. 3078ca613 bugfix: we now throw a Lua exception when ngx.location.capture* Lua API is used inside an HTTP2 request since it is known to lead to hanging. df1b0198f optimize: corrected the initial table size of req socket objects. 988756924 tests: removed duplicate entries in valgrind.supress. 00b92b3d0 style: fixed minor coding style issues found by ngx-releng. fcd0deaff ssl: support enabling TLSv1.3 via lua_ssl_protocols. 9e5cc6e23 bugfix: nginx rewrite directive may initiate internal redirects without clearing any module ctx and rewrite_by_lua* handlers might think it was re-entered and thus it might lead to request hang. thanks twistedfall for the report in #1235. 90d752234 doc: added the new 'init_ttl' argument to the shdict:incr() documentation. a46862afe doc: updated the copyright years in markdown as well. 11aa4636b bugfix: avoided sharing the same code object for identical Lua inlined code chunks in different phases due to chunk name conflicts. e343b3a14 tests: updated valgrind.suppress for latest glibc. c2b6ae2ae doc: updated the copyright years. d125123f8 tests: updated more uses of the server IP addr for agentzh.org to reflect recent changes. 051f35240 doc: setting ngx.header.HEADER no longer throws out an exception when the header is already sent out; it now just logs an error message. 9a3bbb6f2 tests: updated the server IP for agentzh.org to reflect recent changes. 071bb0ff6 doc: typo fix: fix core constants "NGX_XX" to "ngx.XX". 468403e37 feature: added the "init_ttl" argument to the pure C function for the shdict:incr() API. 5f6e74061 feature: added pure C APIs for the remaining time related Lua APIs (for lua-resyt-core). 6d0ecd617 doc: typo fix: fix "\d+" to [[\d+]]. cf5fb9823 tests: corrected the No SNI, No verify case in 129-ssl-socket.t. 01b314522 travis-ci: enabled openssl-1.1.0g builds. 7c8c50300 bugfix: fixed compatibility with older OpenSSL versions like 0.9.8 and 0.9.7. this regression had appeared in commit 7f108923b. 858753bb0 travis: upgraded pcre to 8.41 and openssl to 1.0.2n. 7f108923b feature: added support for OpenSSL 1.1.0. e51a4739a doc: typo fix: fix constrolled to controlled. 34d929857 bugfix: ngx.req.raw_header(): the first part of the header would be discarded when using single LF as delimiter and the number of headers is large enough. c2f68a48e style: minor coding style fixes suggested by our ngx-releng tool. 99a5ba212 feature: added a pure C API function ngx_http_lua_ffi_raw_log for ngx.errlog module's rawlog() function in the lua-resty-core library. 51b7d649a feature: added pure C API function ngx_http_lua_ffi_master_pid() for the get_master_pid() Lua FFI API in ngx.process of lua-resty-core. 20ffd853e feature: implemented pure C function for the pure FFI version of the ngx.get_phase() API function in lua-resty-core. b1b1504ac tests: fixed broken SSL tests due to switch in CA for openresty.org. d6aa6ea1c tests: fixed typos in test tiles in t/124-init-worker.t. 81e140c59 bugfix: pure C API for ngx.var assignment: we failed to output the error message length. 18b5de576 bugfix: the upper bound of port ranges should be 65535 instead of 65536. 9de3dc7ef tests: updated the expected debugging log message for freeing cosocket connection pools. de3b7def1 feature: added pure C API for fetching client address in the SSL handshake phase. 4577a6fbc bugfix: freed all connections when cleaning up socket pools. 4e1a9e1d4 tests: relaxed the checks to account for timing races in error logs from multiple cache helper processes. 927961250 bugfix: use of lua-resty-core's ngx.re API in init_by_lua* might lead to memory issues during nginx HUP reload when no lua_shared_dict directives are used and the regex cache is enabled. 012f3163e optimize: destroy the Lua VM and avoid running any init_worker_by_lua* code inside cache helper processes. 7c7b2e0b1 api: bumped version to 0.10.12. 91d2cd61a bugfix: fixed a compilation error with nginx cores older than 1.11.2 due the lack of the ngx_inet_get_port() C API function (which was first added to nginx 1.11.2). thanks sumantdas for the report. 4f76a377e feature: logged the tcp cosocket's remote end address when connect() times out and lua_socket_log_errors is on. 54135a03e travis: always find out the external IP address of the current travis ci node to help debugging network issues. 7dc97df41 change: fixed a typo in a comment in ngx_http_lua_rewriteby.c. b2aae31a8 tests: use larger timeout threshold values for more openresty.org ssl tests. 3eb1d2f64 tests: use longer timeout threshold. 8af77d3ca doc: we should also work with nginx 1.12.x. ba2b60593 doc: we now work with nginx cores as new as 1.13.6. ed2c9f8e4 release 0.10.11. c6089171d tests: added full GC cycle operations to avoid false positives in the "check leak" test mode. 4b871b45e tests: made one stap-based test case less possible to fail due to timing error. 38780280c updated valgrind suppressions for the hv test mode. 5f766faf0 tests: added new valgrind false positives in the latest nginx core. fd5201c57 tests: valgrind.suppress: removed too aggressive suppressions in nginx mem pools and luajit lj_str_new. 201f7c051 travis: bumped nginx core version to 1.13.6. 7730490c1 dev: util/build.sh: now we require ngx_stream_lua_module to build (for testing and development). 56d309881 bugfix: add fallthrough comment to silence GCC 7's -Wimplicit-fallthrough. 5900df4a6 doc: added "413 Request Entity Too Large" to the possible short circuit response list. 8dd4bdef6 doc: fixed strike-through in shdict.free_space. f829065b7 feature: shdict: added pure C API for getting free page size and total capacity for lua-resty-core. 59dff5eec tests: suppressed one more false positive. 97fbeb0be bugfix: the ssl connections might be drained and reused prematurely when ssl_certificate_by_lua* or ssl_session_fetch_by_lua* were used. this might lead to segmentation faults under load. thanks guanglinlv for the report and the original patch in #1162. bf14723e4 tests: fixed a test case that might fail due to timing errors. 0c8df2fa6 Revert "tests: try to make a test case less possible to fail on slow machines." e5d7fc9fd tests: try to make a test case less possible to fail on slow machines. 93d1f30c3 bugfix: a followup fix for the previous commit. afbfe4cf7 bugfix: the timeout overflow checks did not work on 32-bit systems. aee660bdf bugfix: suppressed the gcc warning "comparison between signed and unsigned integer expressions". 4bbf39928 travis-ci: fixed the IPC::Run dep for Test::Nginx and also added nginx 1.13.5 to the matrix. 3266b40c7 doc: typo fix from dongbeiouba in #1158. 1d01a6d66 doc: documented the shdict:ttl() and shdict:expire() API functions. 37cbafe4e tests: minor tweaks for the http2 test mode. 9a81a6864 feature: added pure C functions for shdict:ttl() and shdict:expire() API functions. c338c7b3f api: bumped version to 0.10.11. ac7615a28 dev: util/build.sh: specify --with-pcre-jit for the nginx build. 837cecb64 tests: fixed ssl ciphers to reflect recent changes in openresty.org's mini CDN network. 1626aaa78 bugfix: *_by_lua_block might break nginx config dump (-T switch). c97473b5e bugfix: segmentation faults might happen when pipelined http requests are used in the downsteram connection. thanks Gao Yan for the report. 36d6ef406 bugfix: tcpsock:connect(): when the nginx resolver's send() immediately fails without yielding, we didn't clean up the coroutine ctx state properly. 77a285163 bugfix: tcpsock: settimeout/settimeouts: throw an error when the timeout argument values overflow. 3fc5aea08 doc: simplified a Lua function call a bit. aee499ac2 doc: minor fixes. e96aec767 doc: fixed the stale Lua module preloading docs as reminded by Denis. b87ad242d tests: skipped a test case which is known to leak memory when lua_code_cache is off. e9609d25c valgrind: suppressed a known false positive inside the nginx core. cdd2ae921 bumped version to 0.10.10. 7b7178a95 bugfix: fixed a compilation error on Windows. this regression had appeaered in 0.10.9. 89de78022 doc: bumped version to 0.10.9. 82b218871 tests: made 2 test cases less possible to fail on slower machines. 691370ec2 Revert "bugfix: ngx.escape_uri: we did not escape URI reserved chars. #1124" f17050518 bugfix: ngx.escape_uri: we did not escape URI reserved chars. #1124 0f0af5094 doc: fixed a typo in a code example for `ngx.re.match`. 51c14a898 bugfix: segmentation fault might happen when a stale read event happens after the downstream cosocket object is closed. thanks Dejiang Zhu for the report. 2fd469d46 refactor: removed the duplicate C function decelaration for ngx_http_lua_socket_read_handler. c26854856 tests: added a test case to make sure $proxy_add_x_forwarded_for is accessible on the Lua land. 1e71ff2cb tests: fixed the vim mode line in a test file. a50947667 bugfix: ngx.semaphore: when nginx workers exit, the harmless error message "semaphore gc wait queue is not empty" might be logged. cc0a793a2 ocsp: removed a useless line of code, which unbreak the libressl build. thanks Kyra Zimmer for the original patch. ef4a0b1db tests: skipped the test case for lua_code_cache off + ngx.timer.every in the "check leak" test mode since there is a known memory leak in this case. 720bd5dbb bugfix: the fake requests/connections might leak when memory allocations fail. c372e1cc0 optimize: made ngx_http_lua_log_ringbuf_header_t have the same size on linux i386 and x64. 67664fef0 minor coding style fixes. e84d69b26 tests: made a slow test less possible to time out on slow machines. 81b8e4823 tests: made a test less possible to fail due to timing error. 4527ec0bb tests: relaxed the expected ouptut constraint in tests for testing ssl host name mismatch. 8827a7f83 bugfix: segmentation fault would occur when several server {} blocks listen on the same port or unix domain socket file path *and* some of them are using ssl_certificate_by_lua* configurations while some are not. thanks petrovich-ua for the report and original patch in #1055. bb30f6d8b bugfix: ngx.escape_uri() did not escape "|", ",", "$", "@", and "`". 3294b1dfd bugfix: ngx.encode_args() did not escape "|", ",", "$", "@", and "`". 66f073128 bugfix: fixed several bugs in ngx_http_lua_log_ringbuf.c. 20d6558b0 feature: balancer_by_lua*: now the user Lua code can terminate the current request with arbitrary HTTP response status codes via ngx.exit(). df708216c feature: errlog capture: now we also record the UNIX timestamp (in sec with msec precision through the decimal part) for each error log entry. 031e00004 doc: use the .ljbc file extension instead of .luac for LuaJIT bytecode files. 9cb970978 tests: updated tests on ssl cosockets to reflect recent changes in our CDN network. 6f49242a8 fixed tests to reflect recent changes. 2360565f5 doc: fixed some typos detected by misspell. 69d995513 bugfix: the running timer counter might go out of sync when non-timer handlers using fake requests are involved (like ssl_certficate_by_lua* and ssl_session_fetch_by_lua*). 7a8798437 feature: added pure C API function +ngx_http_lua_ffi_errlog_get_sys_filter_level for ngx.errlog module's get_sys_filter_level() function in the lua-resty-core library. e80d29257 tests: ssl: avoided those domains using startcom ssl certificates. 993aec8eb refactor: removed the obsolete util/gdbinit script script. we have much better tools in openresty-gdb-utils already. 0c2979399 doc: made it explicit that shdict methods are all atomic. c1317e412 travis-ci: we no longer want to cover nginx 1.9.15. 2dd44623d feature: ngx.sleep(0) now always yield the control to the nginx event loop. 9b16e254e feature: implemented the ngx.timer.every() API function for creating recurring timers. 2a8770493 feature: added new pure C API ngx_http_lua_ffi_process_signal_graceful_exit() for the signal_graceful_exit() function of the ngx.process module in lua-resty-core. 76e213897 change: renamed the C API function ngx_http_lua_ffi_errlog_get_logs to ngx_http_lua_ffi_errlog_get_msg. eb0bb2853 lua_capture_error_log: various documentation fixes and API name changes. ab63ba8df change: renamed lua_intercept_error_log directive to lua_capture_error_log. 4ed1f9605 doc: added more material on capturing error log filtering. 8d8f2c24a doc: documented the lua_intercept_error_log directive. 1a5a33e61 feature: added new config directive lua_intercept_error_log for capturing nginx error logs on Lua land. 6a2b4ff55 doc: a typo fix from Oleg Abrosimov. edbded405 change: bumped API version to 0.10.9. 23cb8e832 travis-ci: enable -msse4.2 when building luajit2. b98da9a19 feature: added pure C functions ngx_http_lua_ffi_worker_type() & ngx_http_lua_ffi_worker_privileged(). f5633cacc feature: added pure C API for tuning the jit_stack_size option in PCRE. c03462637 change: removed util/reindex. put it into the openresty/openresty-devel-utils repo instead. ca8ed0e8c doc: minor tweaks. 39bec7f40 doc: minor tweaks. 6c7ac361f doc: more tweaks in the Installation section. c7d9691e5 doc: more tweaks in the Installation section. 398db9517 doc: more fixes in the Installation section for OpenResty. 55f91d782 doc: updated the Installation section to reflect recent changes. e39e44291 bugfix: fixed typos in error messages. 0459a285c feature: nginx 1.11.11+ can now build with this module. 4b7249342 tests: added passing test cases for testing Lua errors thrown in init_by_lua*. 975c3f838 bumped version to 0.10.8. 385ae4cd1 tests: a followup fix for the previous commit (2ba183d3). 2ba183d3c tests: made a test for duplex cosockets less sensitive to timing error. 94248d64e tests: added valgrind suppression rules for false positives in nginx 1.11.11+ and pcre 3.40+'s JIT compiler. 844e842cb change: removed the use of luaL_getn() macro as it is no longer available in the latest LuaJIT v2.1. fixes #1029. 113d13809 bugfix: lacking the fix from #936 in the C API for lua-resty-core. #1031 6b01840dc change: disabled the mmap(sbrk(0)) memory trick since glibc leaks memory when it is forced to use mmap to fulfill malloc(). 743a10ab0 travis-ci: avoided installing the Test::Nginx perl module; just use it right away. 312bf3ed1 tests: avoided flooding google dns servers in the check leak test mode. 8a6448a39 travis-ci: upgraded pcre to 8.40. 38dd154a7 doc: ngx.exit() also returns immediately in the balancer_by_lua* context. thanks Jinhua Tan for the patch in #1012. 2fd7daa69 bugfix: typo fix in C POST args handler debug log. fdbfdaecf semaphore: fixed a typo in a code comment. e86dd9662 doc: added more hints as comments to installation commands. 11495c28a util/reindex: tweaked the regex to avoid useless substitutions. this is a followup fix for commit 772e6fd. 3217a0781 util/reindex: fixed the shebang line. 2e7031f01 util/reindex: fixed the author and copyright notice. 772e6fdaa tests: removed superfluous empty lines at the end of the test files. 32fea9e66 util/reindex: trims the extra newline characters at the end of the test file. 7f9387ced doc: fixed a typo. a14b9cd37 doc: various wording tweaks and more code examples. e73cd4b90 tweak: guarded SSL related function declarations with the macro NGX_HTTP_SSL. 4fb510f5f fixed a function parameter name. e958cb2ca tests: fixed a bug in testing the nullness of cdata pointers. 827a5d6f8 feature: fixed build compatibility with BoringSSL. 5ae4aba83 travis-ci: upgraded openssl to 1.0.2k. 1028333e4 travis-ci: added checks for use of tabs and source lines exceeding 80 cols. 0c3706298 fixed a coding style issue in the previous commit. 5c54198a3 bugfix: tcp cosockets: sslhandshake(): typo in the error message. 1ada6d0e5 tests: require PCRE 8.39 instead of 8.33 to run our test suite. 39783100f feature: tcpsock:connect(): allows the options_table argument being nil. 5fdbb56ad bugfix: setting response headers would change the Content-Type response header. b3c872e12 added a passing test for #853. da11870db bugfix: balancer_by_lua*: the number of retres might exceed the limit of proxy_next_upstream_tries or alike. 5028d6353 doc: updated copyright notice. 3cf706236 travis-ci: cosmetic "wget" improvement. e7031127e feature: added support for the 303 status code in ngx.redirect(). 6e38c11eb tests: disable IPv6 in resolver. 9ed76a732 travis-ci: several improvements. 26be99def tests: t/090-log-socket-errors.t: avoided connecting to 8.8.8.8:80. 7c9503493 tests: added a passing test for ngx.re.find + \G regexes. db28ece8e doc: a typo fix from Andrei Belov. aa43ca063 doc: stripped line trailing whitespaces. 793531df5 doc: removed ngx.re.split() from TODO section since it is already implemented in ngx.re. 5e59e8c89 bugfix: compilation failures with nginx cores older than 1.9.0. 4bc904222 tests: fixed a perl warning "Unescaped left brace in regex is deprecated, passed through in regex". a24db2cb9 tests: ngx_http_fake_module: removed the coyyright notice since the copyright is already granted. 38dfb174a tests: fixed a bug in the example ngx_fake_delayed module. thanks Dejiang Zhu. also removed the copyright notice in this module since it is already granted. 0a83639f1 tests: avoided solving IPv6 addresses in more tests. 3b42b8bb8 tests: avoided solving IPv6 addresses. 0a1de31ff bugfix: C API: ngx_http_lua_add_package_preload() might not take effect when lua_code_cache is off. ce525fb50 tests: made tests less likely to fail due to bad network. 75b03949c doc: added a note about the LRU regex cache used in the ngx.re.* implementation of lua-resty-core. 006432488 doc: bumped version to 0.10.7. 3cbe5be4a tests: skipped the newly added test case that cannot run in check leak test mode. 7bd68906b doc: log level constants are also available in init_by_lua* and init_worker_by_lua* contexts. ea92f7ea8 doc: documented the support of 307 status argument value in ngx.redirect. 5134a9c82 bugfix: segmentation faults might happen when ngx.exec() was fed with unsafe URIs (#905) 397f3663e bugfix: ngx.req.set_header: skips setting multi-value headers for bad requests to avoid segfaults. 37e536208 change: ssl_session_fetch_by_lua* and ssl_session_store_by_lua* are now only allowed in the http {} context. cf0623c64 tests: 147-tcp-socket-timeouts.t was failing in mockeagain read/write test modes. 521d802aa tests: updated a shdict test case for i386 to reflect our recent optimizations in shdict storage layout. 6b2c9a3bf tests: updated the IP address of our own test server. 73bd64dbc feature: added public C API for 3rd-party NGINX C modules to register their own shm-based data structures for the Lua land usage (that is, to create custom siblings to lua_shared_dict). 40b61f40b doc: fixed the version number since which settimeouts() was first introduced. 28df10b16 feature: added a new api function tcpsock:settimeouts(connect_timeout, send_timeout, read_timeout). 66405877d bumped the API version to 0.10.7; also documented that lua_malloc_trim was first introduced in ngx_lua 0.10.7. 1173cc7c9 feature: added new config directive "lua_malloc_trim N" to periodically call malloc_trim(1) every N requests when malloc_trim() is available. 91fc078c4 doc: use *_by_lua_block {} in the examples. 74bad01b2 travis-ci: cache openssl-1.0.2h-sess_set_get_cb_yield.patch f7a0d58a4 travis-ci: upgraded openssl to 1.0.2j 5c491a59c travis-ci: add nginx-1.11.2 (supported by openresty) d26ca9052 fixed a hard-coded IP address in a test case. da08f59ae optimize: optimized the shdict node struct memory layout which can save 8 bytes for every key-value pair on 64-bit systems, for example. 3bd4227ce made a resolver test case more tolerante. 7ecba5377 travis-ci: use openssl 1.0.2i. 61621e0d3 doc: fixed the link to qa.openresty.org. 8bfa895c3 fixed a code comment. d52116753 doc: fixed a typo. 92d188425 doc: documented how to easily test the ssl_session_fetch_by_lua* and ssl_session_store_by_lua* locally with a modern web browser. 7d242ff79 doc: bumped version to 0.10.6. 4b8f26285 bugfix: *_by_lua_file: did not support absolute file paths on non-UNIX systems like Win32. thanks Someguynamedpie for the report and the original patch in #835. d802dbd87 tests: fixed more shdict list test cases that could fail on i386. 8d0ca5881 tests: fixed a shdict list test case that failed on i386. 8f1608495 tests: wait longer for CPU-intensive test cases for shdict lists for valgrind test mode. addfb0a80 bugfix: shdict lists: fixed new compilation warnings from the Microsoft C compiler. thanks itpp16 for the report in #836. 5dcf4e19e travis-ci: removed the env LUA_CMODULE_DIR=/lib which caused problems. f0687d94c doc: typo fix from Shuxin Yang. 65ccb5644 bugfix: ngx.exit() did not work at all in ssl_session_fetch_by_lua* and ssl_session_store_by_lua* when the FFI API is used (e.g., via lua-resty-core). 1de58835a feature: added new shdict methods: lpush, lpop, rpush, rpop, llen for manipulating list-typed values. d6258dae4 bugfix: build would fail when the http ssl module is disabled. ac89f23f5 travis-ci: disables caching the drizzle7 tarball. f714417ab Merge pull request #829 from doujiang24/doc aad493987 doc: sync the change from README.markdown to wiki c5ada9947 doc: ngx.worker.count() is available in the init_worker_by_lua* context. b9bd8028f feature: shdict:incr(): added the optional "init" argument to allow intializing nonexistent keys with an initial value. dbb48e33a bugfix: segmentation fault might happen in ssl_session_fetch_by_lua*, caught by the clang static analyzer. 5b2e1d20e tests: fixed a typo in the t/143-ssl-session-fetch.t test file. 5bcc53cab feature: implemented ssl_session_fetch_by_lua* and ssl_session_store_by_lua* config directives for doing (distributed) caching of SSL sessions (via SSL session IDs) for downstream connections. a5ac9fa2e bugfix: fake connections did not carry a proper connection number. thanks Piotr Sikora for the patch. b4609c10f bugfix: ngx_http_lua_ffi_ssl_create_ocsp_request: we did not clear the openssl stack errors in the right place. 3f4eba7aa skipped check leak mode for two test cases using malformed requests. 7c69ccdf7 renamed macro HAVE_UPSTREAM_TIMEOUT_FIELDS to HAVE_NGX_UPSTREAM_TIMEOUT_FIELDS. e90e0c1dd bugfix: ngx.sha1_bin() was always disabled with nginx 1.11.2+ due to incompatible changes in nginx 1.11.2+. thanks manwe for the report in #819. 522d2d58c tests: 070-sha1.t: checks error messages in nginx error logs. 8a4328a3e feature: added pure C API for setting upstream request connect/send/read timeouts in balancer_by_lua* on a per session basis. thanks Jianhao Dai for the original patch. 347bb2fba added the PULL_REQUEST_TEMPLATE file. 83c07bd22 minor fixes in ISSUE_TEMPLATE. d51903995 tests: added a passing test case for github #816 where ngx.log() is used in balancer_by_lua*. 93f9f6036 feature: allow tcpsock:setkeepalive() to receive nil args. a27c11f9f travis-ci: moved package management under travis-ci "apt" plugin, also cached apt packages. 349ad466e feature: ssl: add FFI functions to parse certs and private keys to cdata. b63ccaf31 bugfix: "lua_check_client_abort on" broke HTTP/2 requests. 473f7fa28 doc: documented that ngx.req.raw_header() does not work in HTTP/2 requests. 177946446 removed the obsolete Changes file. d14871950 spelling corrections found via github.com/client9/misspell 8e6456e56 bugfix: specifying the C macro NGX_LUA_NO_FFI_API broke the build. thanks jsopenrb for the report in #802. b092aa675 bumped the API version to 0.10.6. e7f6de01a bugfix: segfaults might happen when calling ngx.log() in ssl_certificate_by_lua* and error_log was configured with syslog. thanks Jonathan Serafini and Greg Karékinian for the report in #723. 6fb8a0e99 bugfix: fixed a typo in the error handling of the SSL_get_ex_new_index() call for our ssl ctx index. thanks Jie Chen for the report in #798. cb0923041 fixed various spelling errors in docs, source code, and tests. ff7e6a7a3 bugfix: fixed crashes in ngx.req.raw_header() for HTTP/2 requests. bcecaa07e tests: added a regression test for buffer split in block parsing (#687) e21d9b55e bugfix: when the nginx core does not properly initialize r->headers_in.headers (due to 400 bad requests and etc), more_set_input_headers might lead to crashes. thanks Marcin Teodorczyk for the report. 3010caded added an issue template for github. 1d3d441dc doc: bumped version to 0.10.5. 3b4a96363 bugfix: ngx.flush(true) calls right after ngx.send_header() was broken due to the previous commit. 547c961ef bugfix: ngx.flush() might lead to the "zero-size buf" alerts when ngx.print("") was called before. this regression had appeared in the previous commit. 53e78f5df bugfix: ngx.print("") did not trigger response header sending. be133bca5 bumped the API version to 0.10.5. 5de1b1fac bugfix: use of ssl_certificate_by_lua* in the http {} scope might lead to process crashes. thanks Andreas Lubbe for the report in openresty/lua-resty-core#42. d4f71ad08 doc: bumped version to 0.10.4. 69818f459 bumped the API version to 0.10.4. 816be0073 bugfix: only do the mmap(sbrk(0)) trick on Linux since it may cause problems on other operating systems. c7d5cbdf4 travis-ci: various improvements. b38aefeb7 travis-ci: enables clang builds. thanks Ilya Shipitsin for the patch in #769. 6b8b06060 release 0.10.3. 9f319e956 travis-ci: supress some unuseful output. 91c429a6d travis-ci: cache pcre-8.33 downloads and make sure we "exit 1" on any build failure. 61e2d3a49 travis-ci: use dig to warm-up the DNS servers a bit before testing. dce236188 feature: added Travis CI support. thanks Ilya Shipitsin for the patch in #766. c0efcd3bd fixed a udp test case. 54719b6f7 doc: util/build2.sh is now util/build.sh. thanks Ilya Shipitsin for the patch in #766. c92e71bfe doc: updated the directive execution order diagram. thanks Emil Stolarsky again. c28e17221 util/build.sh: use nginx's builtin ngx_http_auth_request module instead. thanks Ilya Shipitsin for the report in #765. 7352fe869 doc: added diagram of the order of directive execution to README. thanks Emil Stolarsky for the contribution. e7cdb4efd made a shdict test case less likely to fail in slow testing modes. 22566ed9b bugfix: ngx.exit() could not be used in the context of balancer_by_lua* when lua-resty-core was used. 7e6445ef8 bugfix: a follow-up fix for commit 93321acd in the FFI implementation of ngx.status. 70f708071 bugfix: *_by_lua_block: fixed Lua long bracket parsing at buffer boundaries. thanks Maxim Ivanov and Tom Thorogood for the report in #762. 7886a0810 style: fixed lines exceeding 80 cols. 37b476578 fixed a test case. a6b960fe0 refactorings in the semaphore implementation. 9a96f9e85 adjusted the test case for ngx.worker.id() for slow testing modes like valgrind. 0b2093d2b removed useless nginx logs from the nginx fake module in the test suite. 97a6a169a made the test case for ngx.worker.id() more reasonable. 766cde61c tests: made a test less possible to get timed out on resolvers. a0ed1bf29 bugfix: ngx.req.append_body() might enter infinite loops when ngx.req.init_body() has not specified a buffer size and the request header Content-Length is 0 (or client_body_buffer_size is configured to 0). cda5f872c bugfix: ngx.re.match: the 5th argument hid the 4th one. thanks iorichina for the report in #719 and rako9000 for the original patch in #727. ebb648c19 try harder to get the ngx.worker.id() test pass. alas. b90d7ad01 bugfix: wait a bit longer in the test case for ngx.worker.id(). 1967998b0 further tweaks in the test case for ngx.worker.id(). alas. 64499675d tests: ensured all the helper workers are indeed run in the test case for ngx.worker.id(). 05ffc6e9d tests: wait a bit longer for helper processes to start up in the worker.id() test case. a6e4e4583 ngx.worker.id() should still return something when the master process is off. 92d2d44ac simplified the test case in commit 57d034f. c9b02aa19 tests: avoided a memory leak in the test case itself. 57d034f89 bugfix: ngx.worker.id() should return nil in non-worker processes like nginx's cache managers. 8ec587aa7 tests: skip tests using local IPv6 addresses if it is not supported. 0fddb590b feature: now we try limiting the growth of the data segment of the nginx processes to preserve as much lowest address space for LuaJIT as possible. thanks Shuxin Yang for the help. 51d63b41c fixed dtrace static probes for systems other than Linux. b60f53f97 bugfix: fixed a memory leak in ssl.cert_pem_to_der(), caught by valgrind. 6683a8b25 refactor: simplifies the fix in commit 473926654a. df5bf1d62 bugfix: ignore unexpected closing long-brackets in '*_by_lua_block' directives. e6771593b minor coding style fixes. 473926654 bugfix: changing peers in balancer_by_lua* might lead to stale values of $upstream_addr. 559243b2c bugfix: clear errors in pem_to_der functions to avoid flooding nginx error logs (#695). b88ed7fb5 bugfix: ssl: clear stacked errors in some of our Lua APIs to avoid flooding nginx error logs. 1d9b530f7 removed a useless assignment in the timer impl caught by cppcheck and reported by Ilya Shipitsin in #745. b0fbce322 bugfix: sslhandshake() accepts up to 5 arguments now (including the object itself). 256a59c36 added a test case for the previous commit. 99866b50d bugfix: cosocket: sslhandshake() did not correctly check argument count. d44f8e04d Merge pull request #725 from ctrochalakis/typo-fixes a67957d07 Typo fixes 93321acd0 bugfix: assignment to ngx.status might not affect subsequent ngx.status reads when error_page had already taken place. thanks wangwei4514 for the report. 21231a443 bumped API version to 0.10.3. 92c6b8d42 bugfix: init_worker_by_lua* did not honor http {} top-level configurations like lua_ssl_verify_depth and lua_ssl_trusted_certificate. thanks Vladimir Shaykovskiy for the report in #709. 3d61bf4ed doc: bumped version to 0.10.2. b68d7b4bd bugfix: fixed compilation warnings when http ssl module is disabled in the nginx build. this regression had appeared in commit c226a00567. a22a40984 doc: release 0.10.1. bf339b0f6 Merge pull request #699 from othree/patch/readme-typo 493eaa784 Fix conf sample syntax error in README c226a0056 bugfix: balancer_by_lua* might crash the nginx worker when SSL (https) is used for upstream connections. thanks Alistair Wooldrige for the report in #696. e9b437160 minor doc updates. 60ebb5c00 bugfix: hot loop might happen when balancer_by_lua was used with the "keepalive" directive. thanks GhostZch for the report in #693. 6a422b6a4 fixed a test formatting issue. fe96cf835 ngx.req.get_post_args: return error message instead of raising an exception when request body is in temp file. 78426ffa6 bugfix: fixed the compiler warning "unused variable" when compiling with nginx cores older than 1.7.5 (exclusive). thanks Marc Neudert for the patch in #684. 4b063c93d Merge pull request #683 from thibaultCha/docs/get-phase-balancer 9c603e3ff docs: add get_phase() result in "balancer" context c6c905d8a tests: added a (passing) test case proposed by Mathew Heard in #681. 2aa42d572 tests: added passing tests for using ngx.worker.count() in the context of init_by_lua*. 5231d5fb6 doc: updated the markdown version accordingly. d2cedd838 doc: updated the TODO list to reflect recent changes. 20f2e889a tests: increased the waiting time of a test case. b1a326eed bugfix: fixed compilation errors with LibreSSL by disabling ssl_certificiate_by_lua* and some ngx.ssl API functions that are not supported by LibreSSL. thanks George Liu for the report in #654 and Bret for the report in openresty/openresty#148. 3b46731e9 doc: updated the docs of get_phase() for the "ssl_cert" context. 74103392e doc: typo fix from Prayag Verma in #675. 01727a39c feature: added HTTP 2.0 support to ngx.req.http_version(). 4f2954302 feature: this module can now be built as a "dynamic module" with NGINX 1.9.11+ via the --add-dynamic-module=PATH option of ./configure. 91c65907b config: more adjustments. 5adcbefd2 config: refactoring. 5abc7b6bb bugfix: fixed compatibility issues with other nginx modules loaded as "dynamic modules" in NGINX 1.9.11+. 64866bcf4 bugfix: fixed compilation errors with nginx 1.9.11+. thanks Charles R. Portwood II and Tomas Kvasnicka for the report in #669 and #668, respectively. b28eefa2e tests: made two test cases less agreesive in allocations. 320641adf optimize: use lua_pushliteral for string-literal. db206ab85 doc: a follow-up fix for commit 4d77caeb8. b6f5877d1 Merge pull request #671 from typhonius/docos-error-fix 4d77caeb8 Small documentation fix to sample code b98a7f7bb bugfix: stream-typed cosockets: we did not set the "error" field of the ngx_connection_t object which MIGHT lead to socket leaks. d7d454734 bugfix: avoided a potential memory issue when the request handler is aborted prematurely (via ngx.exit, for example) while a light thread is still waiting on ngx.flush(true). 740552fa7 doc: updated the doc for ngx.req.discard_body() to reflect recent changes. now ignoring request bodies indeed trigger disgarding the body upon request finalization. 8d7549fe7 feature: added new API, ngx.config.subsystem, which always takes the Lua string value "http" in this module. fcec9744c made the tests more robust. 43ec78432 renamed util/build2.sh to util/build.sh. e920600f6 doc: mentions ngx_stream_lua_module. 0dabb560c doc: updated the copyright year to 2016. da30ad60a Merge pull request #667 from bjoe2k4/master c16e1e4c0 doc: log_by_lua runs after nginx access log 3bb11aa51 Merge pull request #665 from doujiang24/doc 2a53bb483 doc: add balancer_by_lua*, ssl_certificate_by_lua* to the context of some api da16f8d71 doc: fixed an error in ngx.encode_base64 regarding streaming generation. 5ee9b0dad feature: added new API function ngx.socket.stream() which is an alias to ngx.socket.tcp(). 8961c4943 change: shdict: throws a Lua error when the exptime arg is invalid. bb91590fa feature: ngx.log() and print() now accept tables with the __tostring metamethod. 60bd1b1aa bugfix: support non-RSA private keys as well. a43bc0a1b bugfix: ngx.re: memory over-reads might happen in DFA mode when the regex has submatch capturing groups. 34985cc61 fixed coding style issues introduced in the previous commit. 49d525626 optimize: ngx.re: we always preserve the array part for the 0-indexed capture to avoid (expensive) lua table auto growth. cfd4f904d change: unmatched captures are set to false in the captures table. 701efd5ca bumped API version number to 0.10.1. 753b0a2f8 minor tweaks in a test file. 2c4984f0b a followup fix for the previous commit. e5992f7e4 bugfix: we might not respond to client abort events when lua_check_client_abort is on. cd3c6bd2a minor style fixes. bcdcd85b2 added more bytecode tests that can work with LuaJIT 2.1 and beyond without hard-coding bytecodes in the tests. d44e90dcb added a passing tests using balancer_by_lua* inside a lua subrequest. 6ba92a674 bugfix: balancer_by_lua* did not respect "lua_code_cache off". thanks XI WANG for the report and Dejiang Zhu for the patch in #663. 4c0bf0911 minor tweaks in tests. 36403c160 doc: ngx_openresty -> OpenResty. 4bc2e2d9f doc: documented that ngx.req.get_body_data() is available in the context of log_by_lua*. thanks YuanSheng Wang for the patch in #660. a5a6a12b3 Merge pull request #661 from doujiang24/style f4db0b71e style fix: variable name align with the previous line 93ca1cb75 minor tweaks. 489cc2457 various minor tweaks. dc5ad6019 SSL: remove leading white space from error messages 9de7841ee SSL: set error message on i2d_X509() failure as well f86335b53 minor coding style fixes. 1645a5f0d doc: fixed the year. my brain still lived in 2015. alas. thanks leemingtian for the report. 09644c46a doc: bumped version to 0.10.0. 17621837e bugfix: semaphore: memory invalid reads might happen when using ngx.semaphore in init_by_lua*. 8ac6fe795 made a test case less possible to fail on slow machines due to timing errors. b7fac12c4 Revert "tests: $TEST_NGINX_HTML_DIR might be too long for unix domain socket names." 79527af67 tests: skipped tests for ssl_certificiate_by_lua* if OpenSSL is too old. df130559f tests: $TEST_NGINX_HTML_DIR might be too long for unix domain socket names. 514e6d611 doc: added a note to ssl_certificate_by_lua_block for the use of ssl_certificate and ssl_certificate_key directives. thanks eagle-china for the suggestion. 832dcd1b9 doc: improved the docs for ngx.ctx a bit more. 2293dd228 doc: made clear the ngx.ctx scoping issues. thanks Robert Paprocki for asking. 08c32bc08 now we require at least NGINX 1.6.0. 813d743cc bugfix: fixed compilation errors with nginx cores older than 1.7.5 (exclusive). thanks Mejar Singh for the report. 1fac98574 optimize: saved the event_posted flag maintained by ourselves since ngx_event_t already has such a flag. also moved all the event initialization code to the semaphore initializer. 9f3eb280c bugfix: semaphore: always zero the whole ngx_event_t struct to avoid forward compatibility risks. 3c3cca76e bugfix: fixed compilation failures with nginx cores older than 1.7.12. this regression had appeared in the semaphore commit. 55d28401c bugfix: we should cleanup the current light thread and run the static dtrace probe in ngx.exit() even for fake requests (used by ngx.timer.at and ssl_certificiate_by_lua*, for example). f95d7b0b1 bugfix: remove a line of unreacheable code found by the Microsoft C compiler (via a warning). thanks itpp16 for the patch in #640. 988041615 util/build2.sh: added support for the OPENSSL_INC and OPENSSL_LIB environments. 4fbd5da4c minor doc typo fixes. 6667cb959 doc: updated the links to reflect recent changes. 0d470871e bugfix: ngx.get_phase() did not work in the context of balancer_by_lua*. 6c9d2585a feature: better SSL/TLS handshake control. 884f24eef doc: fixed the literal asterisk escaping in the correct way. a46c07a2a doc: markdown: escaped the literal asterisks properly. e44c9d889 added even more nginx debugging logs to the ngx.semaphore API implementation. 9799d2724 added more nginx debugging logs to the ngx.semaphore API implementation. 295744eaa minor fixes. b84801c48 updated .gitignore to reflect recent changes. 9c3e3cf04 bugfix: balancer_by_lua*: fixed a warning from the Microsoft C compiler. thanks itpp16 for the report in #636. 8c53a0d2d feature: implemented the balancer_by_lua_block and balancer_by_lua_file directives to allow NGINX load balancers written in Lua. e5bf7d69f the next version will be 0.10.0. 822341d8d doc: moved the document section "ngx.semaphore" to a better place. 18551f7c9 doc: fixed the link to the ngx.semaphore module documentation. #584. 9db3f54f4 feature: added pure C API for the ngx.semaphore Lua module implemented in lua-resty-core. d6fa8dbbd minor coding style tweak. 04b05ff2a bumped API version to 0.9.21. 9693828e7 doc: typo fix for the contexts of ngx.worker.id. thanks RocFang for the patch in #634. c655905eb style: various coding style fixes from Dejiang Zhu (found by his enhanced version of ngx-releng) via #630. b21f7993b updated a test case that fail in recent versions. 6a664c839 doc: minor typo fixes. 524be2ea8 fixed a C compiler warning on FreeBSD introduced in the previous commit. 35ba732be bugfix: fixed a compiler warning on type mismatch when dtrace USDT is enabled in the build. 0aa08037d doc: bumped version to 0.9.20. feb634ab8 doc: stated that we work with nginx cores as far as 1.9.7. 87a20d124 tests: fixed SSL cosocoket test cases for server configuration changes. 1d9a77169 refactor: lua code cache: make load functions take a log directly. 2c4045576 bugfix: we lacked detailed context info in error messages due to use of disabled Lua APIs in body_filter_by_lua*. thanks Dejiang Zhu for the patch in #623. 97890587c documented that ngx.worker.id() requires nginx 1.9.1+. fced532fe removed the empty .gitmodules file. ed96fef21 bugfix: compilation failed with nginx <= 1.9.0. thanks huangzihao for the patch in #622. 1ca69efbf a follow-up fix for the previous commit. f54438b6a bugfix: fixed compiler warnings "comparison between signed and unsigned integer expressions" on Windows. c040f1591 improved the tests added in commit 3e086ed3. 2bf771011 fixed the initial table sizes for the tables "ngx" and "ngx.req" to reflect recent changes. 7befc2c5f added one more test case (for ngx.req.clear_header) for commit f48aef50. c9b629ad9 doc: added a note about the full-buffering nature of the ngx.location.capture* API. thanks cmaion for the original patch in #607. 00f62a5ad feature: added new API function ngx.req.is_internal() for testing if the current request is an internal request. c3ac14e23 feature: added many more HTTP status constants as ngx.HTTP_XXX. thanks Vadim A. Misbakh-Soloviov for the patch in #425. f48aef50f bugfix: setting the built-in header X-Forwarded-For via ngx.req.set_header() or ngx.req.clear_header() might not take effect in some parts of the nginx core (like $proxy_add_x_forwarded_for). thanks aviramc for the patch in #491. 932584be2 feature: added new constant ngx.HTTP_TEMPORARY_REDIRECT (307) and support for 307 in ngx.redirect(). thanks RocFang for the patch in #416. b75aa9342 feature: added new config directive "access_by_lua_no_postpone". thanks Delta Yeh for the patch in #580. 7c2801702 doc: documented the minimum size threshold in lua_shared_dict. thanks mlr3000 for the original patch in #616. 3e086ed32 optimize: reduce memory allocations in stream cosockets. f2228aef4 feature: added new API functions ngx.timer.pending_count() and ngx.timer.running_count(). thanks Simon Eskildsen for the patch in #550. 1dee38920 feature: added new API functions ngx.worker.count() and ngx.worker.id() for returning the total count of nginx worker processes and the ordinal number (0, 1, 2, and etc) of the current worker. thanks YuanSheng Wang for the patch in #531. 91f9846c0 bugfix: ngx.req.get_uri_args/ngx.req.get_post_args: avoided allocating a zero-size buffer in the nginx memory pool since it might cause problems. thanks Chuanwen Chen for the report and patch in #605. 91bd1e4e3 optimize: avoid allocating in the nginx request memory pool in stream cosockets' receive*() methods. thanks Lourival Vieira Neto for the patch in #519. 72244ea07 bugfix: fixed a potential data alignment issue in the ngx.var setter API. 87bdfc1a1 bugfix: we had data alignment issues in the subrequest API which can explode on systems like ARMv6. thanks Stefan Parvu for providing the test environment. openresty/ngx_openresty#131. 9fc3a1f2d style: fixed a line exceeding 80 columns in the previous commit. 8b1861679 bugfix: there was a data alignment issue in the tcpsock:setkeepalive() implementation which might lead to crashes on ARM systems. thanks Stefan Parvu for the report in openresty/ngx_openresty#130. fd76e196a bumped the ABI version to 0.9.20. 049feaffd a follow-up fix for #611. 94f68befa bugfix: bogus nginx.conf parse failure "Lua code block missing the "}" character" might happen when there are many Lua code blocks inlined. thanks Andreas Lubbe for the report and test case in #611. 2b9308721 bugfix: bogus "subrequests cycle" errors might occur with nginx 1.9.5+ due to the recent changes in the nginx core. 1fae28928 Revert "tweaked .gitattributes a bit more." 4ab399199 develper build script: disabled the spdy module since it is already removed. fe50cff38 tweaked .gitattributes a bit more. 2fa55e863 added a .gitattributes file to correct GitHub's language tag. 7b1ff62c2 bumped version to 0.9.19. 905d7d0f0 bugfix: using quotes inside a pair of long brackets might lead to parse failures. this is similar to the issue reported by Dejiang Zhu in #596. c31774274 doc: ngx.var: documented the values for undefined and uninitialized nginx variables. thanks Sean Johnson for asking for this explanation in #595. ea3343502 doc: bumped version to 0.9.18. f8e1a7ae7 doc: emphasized that we target NGINX's HTTP subsystem in this module. 4e897529d bugfix: use line comments inside a pair of long brackets might lead to parse failures. thanks Dejiang Zhu for the patch in #596. 809c67432 bugfix: fixed errors and warnings with C compilers without variadic macro support. ec86ade22 bumped the API version to 0.9.18. 9fb2948c4 feature: now we support LuaJIT 2 on Windows (in the form of lua51.dll). 4a9d4b11f bugfix: subrequest response status codes between the range 100 .. 299 (inclusive) might get lost in the return values of ngx.location.capture*() calls. thanks Igor Clark for the report. 2f65b0fff bugfix: we might return the wrong shm zone in the public C API function ngx_http_lua_find_zone(). thanks qlee001 for the report in #589. 2cbeb0c5a doc: bumped version to 0.9.17. 04a57a1d3 doc: fixed a typo. e5c01f3dc doc: use *_by_lua_block {} in the examples in Synopsis; also updated the TODO and Special Escaing Sequeneces sections to reflect recent changes. 9afe2066a documented the log_by_lua_block {} directive. acc823991 documented the body_filter_by_lua_block {} directive. d76317b62 documented the header_filter_by_lua_block {} directive. 51be770ac documented the access_by_lua_block {} directive. 2ba17fd19 documented the rewrite_by_lua_block {} directive. 37167ce58 documented the content_by_lua_block {} directive. def5d5500 documented the init_worker_by_lua_block {} directive. 8daa9a672 doc: use proper wiki syntax. 0025a9827 documented the init_by_lua_block {} directive. 95dd9cd61 documented the set_by_lua_block directive. bf9436ade tests: removed a bogus test case for set_by_lua_block. 195baff55 feature: implemented the set_by_lua_block directive. effd1d1d5 fixed the test serial numbers in t/028-req-header.t. 62e31a3f2 bugfix: fixed typos due to copy&paste mistakes in some error messages. cecc0e789 bugfix: setting builtin request header Upgrade via ngx.req.set_header and etc might not take effect with some bultin nginx modules. 1d640d6e8 a followup fix for commit c96625866. b948841c0 bugfix: setting builtin request headers Depth, Destination, Overwrite, and Date via ngx.req.set_header() and etc might not take effect at least with ngx_http_dav_module. thanks Igor Clark for the report. c96625866 refactor: reordered the request header entries in the ngx_http_lua_set_handlers array to match ngx_http_headers_in in the nginx core. da089df2d doc: updated the wiki file to reflect recent changes. 311539270 tests: removed the useless "use lib" directives from the Perl test files. thanks Markus Linnala for the report in #464. 8b32f3616 feature: initial fixes when being used with the new ngx_http_v2 module since nginx 1.9.5. thanks itpp16 for the patch in #569 and #570. 8a0a3e470 doc: nginx 1.9.3 is compatible. bccf4dab2 bugfix: the user specified ./configure's --with-cc-opt and --with-ld-opt might override the LUAJIT_INC/LUAJIT_LIB and LUA_INC/LUA_LIB environment settings. thanks Julian Gonggrijp for the report in openresty/ngx_openresty#117. ec4076ef3 reverted the last commit. e80109795 skipped test cases that do not make sense for the "check leaks" testing mode. bec51155f fixed line numbers in 132-lua-blocks.t. a688d5a06 doc: a code example misses a "return". thanks YuanSheng Wang for the patch in #572. 6b558cd4b feature: implemented the *_by_lua_block {...} directives that do not require extra escaping when inlining Lua code in nginx.conf. b5de0c2f9 bugfix: fixed one -Wmaybe-uninitialized warning when compiling with gcc -Os. 7e415bbbd optimize: fixed the hash-table initial sizes of the cosocket metatables. c93567d70 doc: more typo fixes from Lance Li in #565. 74aecfe72 doc: typo fixes from Lance Li in #564. 1885b4d29 doc: typo fixes from Lance Li in #562. 826988303 doc: added links to more lua-resty-* libraries. a05e1eb54 bugfix: use of shared dicts resulted in (unwanted) registrations of shared dict metatables on all the lightuserdata in the Lua space. thanks helloyi for the report in #548 and patch in #557. 14f2b88b5 bumped the API version to 0.9.17. b6189f87f fixed the test plan. 69d1a6988 bugfix: if a 3rd-party module calls ngx_http_conf_get_module_srv_conf to fetch its current srv_conf construct in its merge_srv_conf callback, then use of init_worker_by_lua might lead to segmentation faults (the same also applied to merge_loc_conf). thanks chiyouhen for the report and patch in #554. ee30b7ce0 doc: updated the wiki format to reflect recent changes. 73bdb5391 Merge pull request #546 from doujiang24/doc 3043b7163 doc fix: ngx.exit is not disabled within header_filter_by_lua ea195bd81 typo fixes in recently added test cases. b661ff10e bugfix: the if_unmodified_since "shortcut" field in ngx_http_headers_in_t was first added in nginx 0.9.2. 2979422c4 Merge branch 'master' of github.com:openresty/lua-nginx-module bc0d61924 bugfix: ngx.req.clear_header/ngx.req.set_header: we did not update the shortcut fields in ngx_http_headers_in_t added since nginx 1.3.3 which may confuse other nginx modules accessing them. 5e4584312 doc: typo fix from Lance Li. cc2df46d4 minor doc tweaks. 5399898ea bugfix: setting Content-Type response values including "; charset=xxx" via the ngx.header API might bypass the MIME type checks in other nginx modules like ngx_gzip. thanks Andreas Fischer for the report. a22bfb94a Merge branch 'master' of github.com:openresty/lua-nginx-module 7087978d1 fixed SSL cosocket tests with google https in non-US regions. a7857abf1 Merge pull request #538 from tatsuyafw/fix-typo 6d45420d4 Fix typo: use a double quote instead of a single quote b8fc6c589 tests: disabled the test cases exercising multiple http {} blocks since this undocumented feature has been disabled since nginx 1.9.3. 7e201d750 Merge pull request #535 from doujiang24/typofix 336ed3f51 typo fix in debug log 1bf0757a3 Merge branch 'master' of github.com:openresty/lua-nginx-module 289d86b37 valgrind.suppress: suppressed a false positive in the latest version of glibc on Amazon Linux. 51a311c04 removed the old util/build.sh script and also added notes as comments to util/build2.sh #527. f67aefc96 bugfix: we might miss the linker option -ldl when we shouldn't. 91ff51faf bugfix: access nonexistent fields in the "ngx" table in init_by_lua* could lead to the exception "no request object found" because of the overreacting __index metamethod of the "ngx" table. ec3f150cc doc: bumped version number to 0.9.16. b59129ff6 doc: fixed a bug in an example where both rewrite_by_lua and content_by_lua produce response outputs. thanks fengidri for the report in #460. 721fff24f bugfix: fixed compiler warnings at least with gcc 4.7 and clang 3.5. this regression had appeared in commit 9e0503b035. 601044eb3 bugfix: ngx.resp.get_headers(): some built-in headers were not accessible via lowercase. thanks Nick Muerdter for the patch in #529. 9e0503b03 bugfix: raw downstream cosockets did not support full-deplexing. thanks aviramc for the bug report in #478 and the original patch in #481. 0be132078 fixed buggy test cases stuck on request body reading, which were exposed by the previous commit. 6fa6e97cc bugfix: we did not always discard the request body if the user Lua handlers don't, which might cause 400 error pages for keep-alive or pipelined requests. thanks Shuxin Yang for the original patch in #493. 255d40b12 fixed a test case for Mac OS X. 5b35451cd doc: fixed the context for the lua_need_request_body directive. thanks Tatsuhiko Kubo for the patch in #492. f4e131118 feature: fixed compilation failures with nginx 1.9.0. thanks Charles R. Portwood II for the original patch in #500. 847bc0f47 minor fixes in doc. 76dc20d4d Merge pull request #486 from itpp16/patch-3 1db65c105 Update ddebug.h 42d62e4b7 doc: mentioned the "auth_request", "add_before_body", and "add_after_body" directives in the section "Locations Configured by Subrequest Directives of Other Modules". 0fff5888f more coding style fixes in function declarations. edad9bb06 fixed a test case to reflect recent changes in lua-resty-core. 3eadb55c1 more coding style fixes. 65b65bfd9 minor coding style fixes. c9f2b8656 follow-up fix for the previous commit. thanks Tatsuhiko Kubo for the patch in #475. 9531e5e75 bugfix: removed the dead code for the old NGX_THREADS mode which breaks the new nginx (1.7.11+) with thread pool support. thanks Tatsuhiko Kubo for the patch in #475. e7a7079cb add no_padding option to ngx_http_lua_ffi_encode_base64 bbc64d40c removed the git submodule deps/ngx_devel_kit because this is just an optional dependency and it is painful to maintain submodule pointers. ac48bd2b6 doc: added new section "Obsolete Sections" to hold renamed or removed documentation sections so as to keep links valid over the web. thanks Dayo Akanji for the suggestion. 5fa6ff1b6 Updated docs. e3cda9cb8 bugfix: fixed compilation failures with very old versions of PCRE, like 4.5. 054f80f6a bugfix: we might still pick up Lua/LuaJIT headers/libraries in the paths specified by nginx ./configure's --with-cc-opt=OPTS and --with-ld-opt=OPTS optons even when the LUAJIT_INC/LUAJIT_LIB or LUA_INC/LUA_LIB environments are explicitly specified. 6222f0c53 feature: ngx.encode_base64: added support for the "no_padding" boolean argument to disable padding when a true value is specified. thanks Shuxin Yang for the patch. 0f0c2f814 bugfix: we should never automatically set Content-Type on 304 responses. thanks Simon Eskildsen for the patch in #468. e086440cb bumped the API version to 0.9.16. 7c37b4bbd bugfix: use of ngx_http_image_filter_module might lead to request hang due to duplicate header filter invocations. thanks Antony Dovgal for the report. 3dbb2b00e tests: fixed nondeterminism due to unordered Lua table iterations. thanks Markus Linnala for the patch in #465. b2b061d32 Merge pull request #466 from maage/env_lua ff23175f0 fix env tests 8f6790de7 doc: fixed the code sample for ngx.redirect() to reflect recent changes there. thanks Zi Lin for the report. 4388b1e48 doc: bumped version to 0.9.15; also stated that we work with nginx 1.7.10. f88d4a9fb tests: fixed the test plan in 041-header-filter.t. dde606203 Revert "bugfix: header_filter_by_lua*: now we ensure we always forward the exact return value of the ngx_http_filter_finalize_request() calls." e9fa313ff bugfix: header_filter_by_lua*: now we ensure we always forward the exact return value of the ngx_http_filter_finalize_request() calls. 82d0c265b bugfix: using error codes (ngx.ERROR or >=300) in ngx.exit() in header_filter_by_lua* might lead to Lua stack overflow. d427d9a1d feature: improved the debugging event logging for timers created by ngx.timer.at(). 6f63b9730 optimize: fixed padding holes in our struct memory layouts for 64-bit systems to save a little memory. 31265f783 bumped the API version number to 0.9.15. 05a4a7143 bugfix: the value of the Location response header set by ngx.redirect() might get overwritten by nginx's header filter to the fully qualified form (with the scheme and host parts). 8f908775c bugfix: the value of the Location response header set by the ngx.header.HEADER API might get overwritten by nginx's header filter to the fully qualified form (with the scheme and host parts). 23afdc0b1 bugfix: lua_shared_dict: use of Lua numbers as the value in shared dict might lead to unaligned accesses which could lead to crashes on architectures sensitive to address alignment (like ARMv6). thanks Shuxin Yang for the fix and thanks Stefan Parvu and Brandon B for the report in openresty/ngx_openresty#84. a02467304 optimize: header_filter_by_lua*: removed a piece of useless code. thanks Zi Lin for the report. 23c2ceae4 doc: emphasized the capability of using nginx variables in the Lua file path in content_by_lua_file/rewrite_by_lua_file/access_by_lua_file. cea0699a5 updated the copyright years. 20d968bc8 doc: bumped version to 0.9.14. 93a056c84 doc: typo fix from lneto in #451. fe0e22d35 bugfix: tcpsock:setkeepalive(): we did not check NULL connection pointers properly. thanks Yang Yue for the report. a05073d71 doc: typo fix from Harold via #446. 8e79804e0 bugfix: ngx.quote_str_str() incorrectly escaped "\026" to "\z" while "\Z" is expected. thanks laodouya for the original patch in #447. bd51d8196 added passing test cases for #445. 39ff3e697 added tests for using the ngx. API functions in the user callback functions for ngx.re.gsub's replacement. these tests exposed a bug in lua-resty-core. 521e4f454 reindexed the tests in t/036-sub.t. bc120f9a2 bugfix: fixed a compiliation error in the timer module when the DDEBUG macro is set to 1 or a C compiler without variadic macro support (like the Microsoft Visual C++ compiler) is used. thanks itpp16 for the patch in #443. 4cd7644ac bugfix: ngx.timer.at: fixed a small memory leak in case of running out of memory (which should be extremely rare though). c317feeae optimize: save our own log ctx for timers. c6930f018 tests: fixed a test case which expects 127.0.0.1:53 has nothing to listen on, which is not true when a local DNS caching server is enabled. ac009a248 bugfix: ngx.re.gsub/ngx.re.sub incorrectly swallowed the character right after a 0-width match that happens to be the last match. thanks Guanlan Dai for the patch in #442. af16d1f99 feature: added the Lua global __ngx_cycle which is a lightuserdata holding the current ngx_cycle_t pointer. f24a96b80 doc: added two more TODO items. cd01e7b98 doc: updated our TODO list. f9709b6dd api: bumped the version number to 0.9.14. 452640db9 doc: ngx.var: named more readonly nginx builtin variables, as per adamonduty's request in #440. b3a3e5ea2 doc: fixed some formatting issues in markdown. 4c633dd34 doc: added a warning for the "share_all_vars" option for ngx.location.capture*. 7a97d0902 doc: bumped version to 0.9.13 and also claimed the compatibility with nginx cores up to 1.7.7. 5d063412e Merge branch 'master' of github.com:openresty/lua-nginx-module 4720940e8 fixed some new test failures according to the Amazon EC2 report. 3085f32e7 Various improvements in ngx.timer and fake connections/requests. e6132eab9 feature: added nginx configuration file names and line numbers to the rewrite/access/content/log_by_lua directives' Lua chunk names in order to simplify debugging. e22684511 Various downstream writing fixes. bda5b9795 style: minor fixes. 60c64cc14 doc: documented the 0-delay timer workaround for contexts where cosockets are not available (yet). also documented the "connection in dubious state" error message for tcpsock:setkeepalive(). 20bbbfbe4 bugfix: compilation failed when http ssl is not enabled in the nginx build. this regression had appeared in commit 5eb3f8c6f. 3c1918df8 bugfix: ngx.get_phase() does not work in the context of init_worker_by_lua*. 5eb3f8c6f bugfix: tcpsock:sslhandshake(): memory invalid read and/or bogus "lua ssl ceritficate does not match host" errors might happen when checking certificates with the SNI name. da31a5e65 doc: documented that ngx.exit() is enabled in the context of ngx.timer.* callbacks. 0846f2766 tests: increased the timeout threshold for the test cases involved with expensive SSL handshakes to prevent them from getting timed out on slow boxes. 75eaf0784 feature: ngx.flush(true) now returns the "timeout" and "client aborted" errors to the Lua land for the cases that writing to the client is timed out or the client closes the connection prematurely, respectively. 0c33b9e0a feature: ngx.flush(true) can now wait on delayed events due to nginx's limit_rate config directive or "$limit_rate" variable settings. thanks Shafreeck Sea for the original patch in #432. a4f8b8ad0 bugfix: use of "ngx.flush(true)" with the "limit_rate" config directive or the $limit_rate variable may hang the request forever for large volumn of output data. thanks Shafreeck Sea for the report in #430. db428bfc6 doc: added a new section, "Cocockets Not Available Everywhere", under the "Known Issues" section. 1506812af updated valgrind.suppress to suppress a false positive on Amazon Linux i386. 2fe0d8dda more fixes in the tests regarding the resolver. bba7058e7 tests: avoid using hard-coded DNS nameserver address but the TEST_NGINX_RESOLVER environment. d42751731 suppressed a warning in the libc resolver. c2f88f8df bugfix: compilation error when PCRE is disabled in the nginx build. thanks Ivan Cekov for the report in #428. 9ea909bae doc: typo fix from e路相扶. 0162afd71 doc: fixed some broken in-page links, as reported by smallfish in #421. cc9e738a7 doc: various wording improvements and link fixes from Dayo Akanji. c135f05f2 tests: use larger timeout limit for a test case revolved with external DNS resolving. 5c8957b2d tests: fixed a failure due to recent changes in the nginx core. 05e8499c8 tests: fixed a test failure due to the misuse of the $TEST_NGINX_PORT variable. 0d736bf22 tests: suppressed a warning from the test scaffold for a timer test case. 6706ec214 bugfix: when syslog was enabled in the "error_log" directive for nginx 1.7.1+, use of init_worker_by_lua or ngx.timer.at() would lead to segmentation faults. thanks shun.zhang for the report in #426. 8a4e8a72d minor test file format fixes. 25c4bdd6b tests: suppressed a warning from the test scaffold due to an expected [crit] error log message in 2 test cases. c9128e50f tests: added a passing test case for connecting to IPv6 addresses via cosockets. 4323f3bc1 tests: 129-ssl-socket.t: use limited timeout threshold for the cosockets. 0c4528e50 bugfix: fixed compilation error with nginx 1.7.5+ because nginx 1.7.5+ changes the API in the events subsystem. thanks Charles R. Portwood II and Mathieu Le Marec for the report in #422. 14fbf4031 doc: made clarification about ngx.exec() requested by Dayo Akanji. e9139a954 doc: typo fix from tianchaijz in #419. 227a5f0e5 api: bumped version to 0.9.13. 334979177 bugfix: ngx.req.raw_header(): buffer overflow and the "buffer error" exception might happen for massively pipelined downstream requests. thanks Dane Knecht for the report. ddb363625 refactor: ngx.req.raw_header(): simplified the implementation. 62fd4c5f7 bugfix: ngx.req.raw_header(): we might change nginx's internal buffer pointers, which might cause bad side-effects. 73884588f doc: bumped version to 0.9.12. ffe7b34de doc: added more discussions for the potential race conditions in worker-level changeable data sharing to the "Data Sharing within an Nginx Worker" section. thanks Jon Keys for asking. d7378122d tests: fixed a small bug in a test case. be1655d23 bugfix: added extra delays to some of the test cases with systemtap involved. 8e6aa11dc tests: updated test suite according to the latest changes in Test::Nginx::Socket. 9688c645b doc: documented the behavior in the case that one does not call close() nor setkeepalive() in a cosocket object's lifetime. thanks Bogdan Irimia for asking. eb128df04 bugfix: added allocation failure check for ngx_array_init(). thanks Tatsuhiko Kubo for the patch in #414. 0e49fe746 tests: fixed a case with expired CRL. 5662ddd9b bumped internal code version to 0.9.12. 7e4f1af7f bugfix: init_worker_by_lua*: memory corruptions would happen when no server {} is defined in nginx.conf. this regression had appeared in v0.9.11. df70a5e7e bugfix: fixed build failures with OpenSSL older than 0.9.8f. thanks FFCZ for the report in #413. 044f86188 bugfix: create_loc_conf did not return NULL on error. 96d4608ef tests: fixed a case for raw req socket to reflect recent changes in the debugging logs for tcp_nodelay. 3acb8dd90 bugfix: the "tcp_nodelay" directive configuration was not honored by upstream TCP cosockets, which could lead to extra delays for small messages. thanks Shun Zhang for reporting this issue. 947f82d1b bugfix: compilation failed with nginx 1.3.6 or older. this regression had appeared in the v0.9.11 release. 1565a068e bugfix: compilation failed with nginx 0.9.x. e2aef6d03 doc: bumped version to 0.9.11; also claimed that we work with nginx 1.7.4. 4c19852c0 doc: typo fix. da0ced8a4 bugfix: init_worker_by_lua* would conflict with some other nginx C modules (like ngx_proxy) when their merge_loc_conf callbacks (or alike) produce side-effects in cf->cycle. thanks Ruoshan Huang for the report. d4dbba59d config: now we also explicitly check the Lua ABI/language version in our feature test for a Lua lib. 90bdd9744 fixed the build failure introduced in commit 109fd454a. b6978cde6 Merge pull request #409 from cubicdaiya/feature/vim e4691cb5c Merge pull request #410 from cubicdaiya/feature/use_macro 99cc06d0f Merge pull request #411 from cubicdaiya/feature/ues_luapushliteral2 109fd454a use lua_pushliteral for string-literals. 8e464f9ae Style: use macro instead of magic-number. 7f739a983 Style: added vim modeline. d957eefee tests: made a test case for ngx.on_abort() more tolerant. e0cd3ccf1 bugfix: ngx.resp.get_headers(): sometimes we might omit the builtin-headers Content-Type, Content-Length, Connection, and Transfer-Encoding. thanks Jon Keys for the report. 75cc29ea6 bugfix: ngx.req.socket(true): it incrrectly returned the error "chunked request bodies not supported yet" for *raw* request sockets with chunked request bodies. thanks Xiaofei Yang for the report. 5f62a5584 tests: fixed a test case that could fail randomly. 3ffe48cce bugfix: tcpsock:sslhandshake() incorrectly returned failures when the SSL handshake operation succeeded immediately. 03a74d445 tests: fixed a test case to reflect latest change in ngx_set_misc. ad3364515 Merge pull request #408 from cubicdaiya/issues/use_luapushliteral 06652edb1 bugfix: we did not check allocation failures while compiling the pattern for tcpsock:receiveuntil(). thanks Tatsuhiko Kubo for the patch in #407. 141725f4c use lua_pushliteral for string-literals. 05e2ad61f doc: removed the SSL cosocket item from the TODO list. 92d92fbff style: fixed tab indentation. thanks Tatsuhiko Kubo for the patch in #406. e482cdab3 doc: more clarification in the docs for the res.truncated flag returned by ngx.location.capture(). thanks Jon Keys for asking. 2b40b44dc doc: documented the new SSL cosocket feature. fd3f4ee25 bugfix: tcpsock:sslhandshake(): the "host" parameter did not accept the nil value. 45cb4feb1 doc: added missing method name "get_keys" under "ngx.shared.DICT" and also fixed the method order. thanks George Bashi for the patch in #404. e7d89c043 bugfix: builds without --with-http_ssl_module were broken. this regression had appeared in commit a6a0ed5. b55d0ecf5 feature: tcpsock:sslhandshake(): when the "session" argument is a boolean "false", then no SSL session userdata will be returned and only a boolean "true" value is returned when successful. 207865762 tests: use iscribblet.org instead of agentzh.com in tests because the latter is currently served by Chinese name servers, which are not quite stable. 90751a071 tests: fixed a case regarding ngx.on_abort(). 82188a1e8 tests: made a test regarding ngx.re.sub less possible to fail in slow testing modes. 937dfb35e tests: a minor style fix in a case. a844a13ce bugfix: we did not set the c->pool->log properly where c is an upstream stream-typed cosocket connection. this regression had appeared in the ssl cosocket patch, i.e., commit 5aed1966. 3f9ab4bf6 tests: suppressed a valgrind false positive in the nginx core. a6a0ed520 bugfix: memory leak cound happen when both cosocket connection pools and "lua_code_cache off" were used. this regression had appeared in the ssl cosocket patch, i.e., commit 5aed1966. 531fb5a08 tests: one minor Perl code style fix. 348d359dd tests: fixed the test case added in commit 6ef948150. 5aed1966c feature: SSL/TLS cosocket API 6ef948150 added a test case to exercise a bug in ngx_proxy's ssl handshake timeout handling (see http://mailman.nginx.org/pipermail/nginx-devel/2014-July/005627.html ). 8acc73f2c bugfix: stream-typed cosocket might read uninitialized memory bytes when logging errors due to sending to or receiving from a closed socket. 766ab667c tests: fixed a test case regarding unix domain cosockets. 353563226 optimize: we now cache the userdata metatable (for the __gc metamethod) in the lua registry for the datagram-typed cosockets. 3fd3234f3 optimize: we now cache the userdata metatable (for the __gc metamethod) in the stream-typed cosocket implementation. 58f916f13 bugfix: the datagram-typed cosocket resolver handler did not handle some special errors correctly. 2cc788b42 improved the fix in commit 48e48305. 48e483050 bugfix: the stream-typed cosocket resolver handler did not handle some special errors correctly. c2f4dda29 trivial optimizations. 66c45338c doc: markdown: fixed the "Back to TOC" links for the sections ("Nginx API for Lua" and "Directives") with inlined TOC. thanks Pierre-Yves Gérardy and Simon Eskildsen for the reports in #370 and #399, respectively. 92e22bc43 bugfix: body_filter_by_lua*: reading ngx.arg[1] after clearing ngx.arg[1] (by assigning nil or "") could lead to segmentation faults. this regression had appeared in v0.9.10. thanks Jason Stangroome for the report in #398. f3870f6a7 bugfix: ngx.req.raw_header() would return garbled data when LF instead of CRLF is used as the line terminator in the original header. b5d23b9e4 bugfix: ngx.req.raw_header() could lead to buffer overflow and the "userdata length overflow" error due to misuse of r->header_end while modules like ngx_fastcgi and ngx_proxy can change r->header_end to point to buffers of their own. thanks sadmedved for the report. e4e0f4b37 doc: improved the wording in the "Lua Coroutine Yielding/Resuming" section. thanks Hungpu DU for the report in #394. dfb61faeb bugfix: we did not use lua_checkstack() to prevent Lua stack overflow in our own C-land Lua backtrace generator. e1b24308a refactor: removed a piece of duplicate code from the stream-typed cosocket implementation. 35e174b4f optimize: reading ngx.header.HEADER: eliminated dynamic allocations and data copying when there is no need to ransform "_" to "-" in the header name. ee2a206b2 feature: added pure C API function for FFI-based implementation of reading ngx.header.HEADER. b6e991ba9 tests: improved the test cases for the ngx.header API a little bit. d380c975b doc: improved the wording of the documentation for ngx.req.clear_header() to prevent ambiguity. thanks Christophe-Marie Duquesne for the report in #393. ed096adaf style: fixed coding style in the header files consts.h and args.h. thanks Tatsuhiko Kubo for the report in #392. f83fa0d4d bugfix: fixed an incorrect error message. thanks aviramc for the patch in #290. 4969b87a2 style: preserved a blank line after the goto labels. 790e57dee optimize: reading ngx.header.HEADER: reduce allocations in the nginx request memory pool. c37e6a6e5 change: use the type ngx_http_lua_ffi_str_t instead of ngx_str_t in the pure C function ngx_http_lua_ffi_req_get_headers. cee6659f6 doc: documented that the standard coroutine API is now available in the context of header_filter_by_lua* and body_filter_by_lua*. 1238bdd9f doc: documented the NGX_LUA_NO_FFI_API C macro. 7ff3ef1f1 renamed the NGX_HTTP_LUA_NO_FFI_API macro to NGX_LUA_NO_FFI_API. e94a4f371 feature: added pure C API functions for FFI-based implementations of ngx.worker.pid() and ngx.worker.exiting(). a2e53c4f5 bumped the code version to 0.9.11. 17c28f1ac feature: the standard coroutine API is now enabled in the context of header_filter_by_lua* and body_filter_by_lua*. thanks ngo for the request in #389. 0778f2b04 feature: for content/rewrite/access_by_lua_file directives, we now return 404 status code instead of 500 in case that the specified .lua file cannot be opened. thanks Sam Lee for the suggestion. 76c70010b doc: fixed a wrong statement regarding require() in the "Lua Variable Scope" section. thanks Hungpu DU for the report in #390. 34ecd2f13 bugfix: ngx.escape_uri() now uses uppercase hexadecimal digits for percent-encoding according to the recommendation in RFC 3986. thanks Piotr Sikora for the suggestion. 5e9446378 bugfix: for statically linked luajit, we need to pass -ldl to the linker. thanks cf2012 for the report in openresty/ngx_openresty#40. 6929e7de9 doc: documented the behavior of init_by_lua* when lua_code_cache is off. cea9ee2cd doc: bumped version to 0.9.10. f3102fef3 minor fixes in the NGX_LUA_ABORT_AT_PANIC macro. de46d204b bugfix: fixed a compilation error regression when using the Microsoft Visual C/C++ compiler. thanks itpp16 for the patch in #388. 1e07b1ead bugfix: we should use "c->buffered & NGX_HTTP_LOWLEVEL_BUFFERED" instead of "c->buffered" for testing if the downstream connection is busy writing. aa6054a13 change: throw out the "no memory" Lua error consistently (instead of "out of memory") when failing to allocate on the nginx side. 9c79180b7 bugfix: we did not handle an out-of-memory case in ngx.req.set_body_data(). 5ad9b3fbb bugfix: rewrote the buggy patch in commit 4c215c556 for #386 because it did not handle flush bufs correctly and had other issues. bda34bb09 fixed 2 minor lua stack manipulation mistakes. 88be20583 bugfix: ngx_http_lua_chain_get_free_buf(): avoided returning zero-sized memory bufs. fd8af73d2 refactor: renamed ngx_http_chains_get_free_buf() to ngx_http_lua_chain_get_free_buf(). also omitted the buf tag argument which is a constant anyway. 6b8ca4a35 doc: typo fix. c29f33adf doc: documented the NGX_LUA_USE_ASSERT and NGX_LUA_ABORT_AT_PANIC C macros. 4c215c556 bugfix: body_filter_by_lua*: we might incorrectly pass zero-size bufs (in the form of "special sync bufs") at the beginning of a chain, which could get stuck in the buffer of ngx_http_writer_filter_module (or in other words, being "busy") while could still get recycled in the content handler (like content_by_lua), leading to buffer corruptions. thanks westhood for the report and patch in #386. 26fd00704 bugfix: we did not clear all the fields in ngx_buf_t when recycling chain link buffers. fdd10bf3a tests: use larger timeout threshold for test cases involved with external resolvers. b106ccdb4 fixed the test plan in 014-bugs.t. 8613ed6e9 bugfix: the *_by_lua_file directives failed to load .lua files of exactly the size n*LUAL_BUFFERSIZE bytes with the error "'end' expected (to close 'function' at line 1) near '<eof>'". thanks kworr for the report in #385. db9fe7ab9 bumped version to 0.9.10. 745a7107b optimize: now we turn off our C-land assertions by default unless the user explicitly specifies the C compiler option -DNGX_LUA_USE_ASSERT. 3abfb1fc6 bugfix: when the ngx.on_abort() user thread was created but never run *and* some other pending user thread was aborted prematurely, the latter thread might get leaked. thanks Dane Knecht for the report. this regression had appeared in the v0.9.9 release. 1250c5bf4 tests: use larger resolver_timeout settings. 09e0944d6 change: now we always iterate through all the user light threads to ensure all threads are de-anchored even when the "uthreads" counter gets out of sync. also added an assertion on the "uthreads" counter. 24953436f doc: documented the new full-duplex stream cosocket feature. f408dd51a doc: documented the ngx.thread.kill() API function. 0950973ad doc: bumped version to 0.9.9. also states that we work with nginx 1.7.2. f40e371be Revert "refactor: we no longer call ngx_pfree() in our own pcre_free hook." fcbbf523d tests: fixed timing issues in some of the test cases for full-duplex cosockets. d56a2af52 bugfix: fixed the initial size of the ngx.worker table and the misleading comment due to a copy&paste mistake. thanks Suraj Jaiswal for the report. 934e33e6d feature: cosockets are now full duplex: a reader "light thread" and a writer "light thread" can operate on the same cosocket simultaneously. thanks shun zhang and aviramc for the original patches in #367 and #290, respectively. 6885462e9 feature: added new API function ngx.thread.kill() for killing a user "light thread". thanks aviramc for the original patch in #288. 52b76a719 removed some dead code from the stream cosocket implementation. d6bc02eb3 bugfix: the coroutine API table introduced by require("coroutine") was not working in the context of ngx_lua. thanks Paul K and Pierre-Yves Gérardy for the report (in #381). c2e29483d a minor coding style fix. 9f0f9eaf1 tests: made a test case in 124-init-worker.t less possible to fail in slow testing mode. b773bcabc bumped version number to 0.9.9. fd41af2d0 bugfix: we incorrectly overrode coctx->data before calling coctx->cleanup, which could lead to memory corruptions. this regression had appeared in the previous commit, f19e27e777. f19e27e77 bugfix: the coctx cleanup handler might not be called before being overidden by other operations. this could happen when failing to yield in an error handler (for xpcall). 053f40e79 bugfix: fixed an incorrect error message. thanks doujiang for the patch in #373. 75c98cb5f fixed the test plan in 058-tcp-socket.t. 8fd50ad87 ensured that the resolver handler will not call into the dead request context. 06b7476b2 doc: added performance notes to the sections for ngx.var and ngx.ctx. 7a20b0770 doc: fixed a typo. ab8bd1b02 doc: documented the values can be passed to the timer callback function. 73e831f04 bumped version to 0.9.8. 2b721c7fd doc: markdown format: inlined the TOC for the long sections "Directives" and "Nginx API for Lua" as per Pierre-Yves Gérardy's suggestion in #370. c91e1f525 doc: moved the "Directives" and "Nginx API for Lua" sections to the end because they are too long and kinda boring :) thanks Pierre-Yves Gérardy for the patch in #371. a9e0111fe doc: moved important sections to the front. thanks Pierre-Yves Gérardy for the patch in #371. 91e3307fb use ngx_http_lua_assert() instead of plain assert() across the code base. ec2498a81 added assertions to the coroutine scheduler to ensure that we do not pop or push the wrong number of stack slots for yielded coroutines. 5318f3a69 resolved merge conflicts. d3ab0edd4 bugfix: ngx.req.set_method(): we incorrectly modified r->method when the method ID was wrong. 31e001557 feature: added a pure C API function for FFI-based implementations of ngx.req.set_header() (single-value only) and ngx.req.clear_header(). 3a01812d8 feature: added a pure C API function for FFI implementations of shdict:flush_all(). 62b2ac5cb feature: added pure C API function for FFI-based implementations of ngx.req.set_method(). f9ce770d7 feature: added pure C API functions for FFI-based implementations of ngx.req.get_method(). 1c3a84162 Revert "optimize: use lua_pushinteger instead of lua_pushnumber in ngx_http_lua_ngx_time()." 9bb1f3586 the "int" return type of ngx_http_lua_ffi_time might lead to data loss. thanks itpp16 for the report. e9b8563c3 optimize: use lua_pushinteger instead of lua_pushnumber in ngx_http_lua_ngx_time(). 99e5171c6 renamed ngx_http_lua_ffi_ngx_now to ngx_http_lua_ffi_now. d9fff3b70 feature: added pure C API function ngx_http_lua_ffi_time for FFI-based implementations of ngx.time(). 8666424db fixed the wrong return type of the ngx_http_lua_ffi_req_start_time function in the previous commit. 50dbfcefd feature: added pure C API function ngx_http_lua_ffi_req_start_time for FFI-based implementations of ngx.req.start_time(). 34ab51f89 updated tests to reflect recent changes in rewrite_by_lua* and access_by_lua*. 4f0be44f7 doc: added more explanation for some user FAQs. ec78bf101 fixed a source line exceeding 80 cols. 32960150f minor doc love. 938323644 change: rewrite_by_lua* will now terminate the current request if the response header has already been sent (via calls like ngx.say and ngx.send_headers) at that point. a1ea105f4 change: access_by_lua* will now terminate the current request if the response header has already been sent (via calls like ngx.say and ngx.send_headers) at that point (otherwise nginx might crash when other modules try to generate their own response). thanks yaronli and Sophos for the report in #364. c478f41e1 change: access_by_lua* will now terminate the current request if the response header has already been sent (via calls like ngx.say and ngx.send_headers) at that point (otherwise nginx might crash when other modules try to generate their own response). thanks yaronli and Sophos for the report in #364. b438f972d feature: now we save the original pattern string pointer value into our ngx_http_lua_regex_t struct, to help runtime regex profiling and debugging. 7f184ec4c feature: now we save the original pattern string pointer value into our ngx_http_lua_regex_t struct, to help runtime regex profiling and debugging. fb5f97541 feature: attempt to allow use of 3rd-party pcre bindings in init_by_lua*. thanks ikokostya for the feature request in #368. cae725928 added a fix for the leftover cases in commit b57d60d4c9d c178302bd updated the test index in 109-timer-hup.t. 0a11b402a feature: added pure C API function, ngx_http_lua_ffi_ngx_now, for FFI-based implementation for ngx.now() like lua-resty-core. 0a845986a 126-shdict-frag.t: force a full GC cycle at the end of the Lua handler to help the "check leaks" testing mode. a43bca8d1 fixed the wait time for slow testing mode. eb4f98676 126-shdict-frag.t: increased the timeout threshold. 0f68763de bugfix: nginx does not guarentee the parent pointer of the rbtree root is meaningful, which could lead to inifinite loops when ngx_lua tried to abort pending timers prematurely (upon worker exit). thanks pengqi for the patch in #362. a2dee0c62 added more code comments to the timer implementation. af2d3570b added a (passing) fuzz testing for aborting many pending timers. 3b3239c22 added (passing) tests for yielding failures in cosocket DNS resolving. 5d614b094 added a (passing) fuzz test case for shdict. b57d60d4c bugfix: we did not call our coroutine cleanup handlers right after our coroutine completes (either successfully or unsuccessfully) otherwise segmentation fault might happen when the Lua VM throws out unexpected exceptions like "attempt to yield across C-call boundary". thanks Lipin Dmitriy for the report in #361. 509bb9819 removed an obsolete code comment. ed1eb4f7f bugfix: the ngx.ctx table might be released prematurely when ngx.exit() was used to generate the response header. thanks Monkey Zhang for the report. now we release ngx.ctx in a request pool cleanup handler. f7443edc1 fixed the test index in 126-shdict-frag.t. 373376ce0 try to make a test case for shdict fragmentation pass on i386. fa83bb5fd added tests for exercising the memory fragmentation issue in nginx's built-in allocator for blocks larger than the page size d8c45b872 feature: make use of the new shm API in nginx 1.5.13+ to suppress the "no memory" error logging when the shared dicts run out of memory. ae2207bf8 bumped version to 0.9.8. 125586404 feature: added C macro NGX_LUA_ABORT_AT_PANIC to allow generating a core dump when the Lua VM panics. 506728da2 doc: fixed the links to ngx_rewrite in the "set_by_lua" section. 39d3e74cb updated docs to reflect recent changes. 6c555ed50 bugfix: bugs in the error handling for pure C API functions for shared dict. thanks Xiaochen Wang for the patch in #365. c11ceb40a updated the tests to reflect the new openresty server at agentzh.org. b111180c1 added a (passing) test case for reading ngx.header in the context of log_by_lua. c1ee08e8a Merge pull request #359 from cubicdaiya/issues/use_ngx_str_null 0d48124c9 added a (passing) test for timeout error on tcpsock:receive(N). 0375856d8 use ngx_str_null e52a2631e doc: now we have tested with nginx 1.5.12; also put the 0.9.7 release date. 40691f409 Revert "added assertions for the pcre pool management." 1117f043c Merge pull request #355 from lhmwzy/master 8192b9745 Update ngx_http_lua_string.c 4e284f73c bumped version to 0.9.7. 5c2718004 added assertions for the pcre pool management. 5c788b8b9 refactor: we no longer call ngx_pfree() in our own pcre_free hook. 988ac5d84 bugfix: when lua_code_cache was off, cosocket:setkeepalive() might lead to segmentation faults. thanks Kelvin Peng for the report. f08bddccd suppressed a false positive in libdl. 3f7e04cf8 made a test case less likely to fail on slow machines. cbf054f12 made a test case less likely to fail on slow machines. 01cd00c40 Merge branch 'master' of github.com:chaoslawful/lua-nginx-module 8542d4365 refactor: improved the error handling and logging in the Lua code loader and closure factory. 5719c60cf Merge pull request #351 from cubicdaiya/issues/use_luapushliteral f07a55b28 use lua_pushliteral instead of lua_pushlstring bbb7e05d9 added stronger assertions to the stream-typed cosocket implementation. 5d4afab7a optimize: we no longer clear "ctx->user_co_ctx" in ngx_http_lua_reset_ctx. bec802ea9 bumped version to 0.9.6. e5eefed32 updated docs to reflect the change in commit 382c7201. f9917b93e skipped 2 test cases that are nonderterministic. 4cb8dda8b bugfix: accessing a datagram cosocket object from a request which does not create it could lead to segmentation faults. now we throw out a Lua error "bad request" properly in this case. 414db1a80 bugfix: accessing a cosocket object from a request which does not create it could lead to segmentation faults. now we throw out a Lua error "bad request" properly in this case. thanks Ross Timson for the report. 382c72010 change: it is now the user's responsibility to clear the captures table for ngx.re.match(). a4db3e1b2 bugfix: we should prefix our chunk names for from-string lua source (which also leads to nicer error messages). thanks Mike Pall for the catch. 6c56337d7 bugfix: init_worker_by_lua should honor the lua_socket_log_errors directive's configuration in the http {} block. 9b18ca311 bugfix: the "resolver" directive's toplevel configuration in the http {} block was not respected by init_worker_by_lua. thanks Heero Zhang for the report. 37c86d67f bumped version to 0.9.6. be08630ba bugfix: subrequests initiated by ngx.location.capture* with the HEAD method did not result in responses without response bodies. thanks Daniel for the report in #347. 97d916233 updated docs for the 0.9.5 release. cfc593bb9 test: skipped two invalid test cases that use cosockets beyond the creating request boundary. 3898993eb fixed a bad regressoin in commit 1b615c46. fb06f3958 fixed a test case that could fail in the "check leak" mode due to GC delays. 1b615c46e bugfix: segfault might happen in the FFI API for destroying compiled pcre regexes, which affects libraries like lua-resty-core. c6e28fdc0 fixed the waiting time for a test case that could fail on slow machines. e0c5d58f2 doc: typo fix in a code sample for ngx.req.get_post_args(). thanks Evan for the patch in #344. 880a1c85b refactor: adjusted the globals table handling a little bit. 911c39553 increased the waiting time in two ngx.abort test cases that might fail on slow boxes. dc8e88cc2 feature: explicitly check Lua langauge version mismatch; we only accept the Lua 5.1 language (for now). 9ef3ca51e removed the spdy mode check from ngx.location.capture*() to renable this API again for SPDY requests. d74878969 bugfix: an attempt to fix subrequests initiated by ngx.location.capture*() in the SPDY mode. 48af6433b doc: documented the new ngx.config.nginx_configure() function. 1916d0c2f renamed ngx.config.ngx_configure to ngx.config.nginx_configure. 441d9c28b feature: added new API function ngx.config.ngx_configure() to return the NGINX ./configure arguments string to the Lua land. thanks Tatsuhiko Kubo for the patch in #339. f86291583 doc: documented the ngx.resp.get_headers() API function. 887f0f99d feature: added new API function ngx.resp.get_headers() for fetching all the response headers. thanks Tatsuhiko Kubo for the patch in #335. 4a0036c07 optimize: coroutine status string look-up is now a bit more efficient by specifying the string lengths explicitly. thanks Tatsuhiko Kubo for the patch in #338. eab56942a doc: fixed a typo in the doc for coroutine.yield(). thanks Ruoshan Huang for the report. f7db5fddb doc: fixed linkrot of mod_lua. thanks Tatsuhiko Kubo for the patch in #336. ec368b46f refactor: removed an unused parameter, "len", in ngx_http_lua_ffi_script_eval_data. df7bf56af doc: documented the new ngx.worker.pid() API. 7460a8d16 adjusted a test case that could fail on slow machines. e5c1105be bugfix: fixes for small string buffer arguments in the C API for FFI-based implementations of shdict:get(). 4112e749d bugfix: fixed the error message buffer overwrite in the C API for FFI-based ngx.re implementations. 766896378 skipped tests that could fail in the "check leak" testing mode. 3eafa8df1 better context info in the error messages for init_by_lua* and init_worker_by_lua*. a1c15f46b fixed an erorr message in ngx_http_lua_report. 92219bba5 feature: added new API function ngx.worker.pid() for retrieving the current nginx worker process's pid. a6e0f512e reindexed the tests in t/058-tcp-socket.t. 6525ec0d0 change: turned off lua_socket_log_errors in init_worker_by_lua*. 2c4534ab2 test: now we require the ngx_lua_upstream module for the test suite. 096e2ff8e doc: updated the "TODO" section to reflect recent changes. 870b9a7f1 test: use smaller port numbers to reduce the chance of conflicting with local ports. 2079446fa bugfix: use of the public C API in other nginx C modules (extending ngx_lua) lead to compilation errors and warnings when the Microsoft C compiler is used. thanks Edwin Cleton for the report. 47836cec1 bugfix: segmentation faults might happen when multiple "light threads" in the same request manipuate a stream cosocket object in turn. thanks Aviram Cohen for the report. c00535402 bugfix: timers created by ngx.timer.at() might not be aborted prematurely upon nginx worker exit. thanks Hamish Forbes for the report. 1d85a61f6 doc: mentioned ngx.timer.at for doing background jobs in ngx.eof's documentation. c5c8a1281 doc: markdown formatting fixes from Peter Cawley in #326. d633e34a3 added a test case to exercise a bug in $args (it requires the setting_args_invalidates_uri patch for the nginx core to pass). 7e96a2dda doc: typo fix from Zheng Ping. c07aac16e bugfix: fixed some new warnings when using Microsft's C compiler. thanks Edwin Cleton for the patch. bbaa57d2a doc: added a code example for init_worker_by_lua. 484e7df2f doc: documented init_worker_by_lua and init_worker_by_lua_file. also updated the copyright years. 9fc675f68 added more (passing) tests for init_worker_by_lua*. 356661d6b feature: added new configuration directive, init_worker_by_lua, to run Lua code upon nginx worker process startup. 81daa5356 updated .gitignore a bit. 6ba574878 minor label name fixes. 50f5b1b92 bugfix: the return value sizes of the C functions ngx_http_lua_init_by_inline and ngx_http_lua_init_by_file were wrong. 8c74fb922 bumped version number to 0.9.5. c18e03c5c refactor: made C functions ngx_http_lua_report and ngx_http_lua_do_call global. 238ace2f7 refactor: abstracted out the ngx_http_lua_create_fake_request function from the ngx.timer code base. b90bb2a57 refactor: abstracted out the ngx_http_lua_create_fake_connection function from the ngx.timer code base. 6169a191d documented the 5th optional argument, "res_table", for ngx.re.match(). eb43c9c7d doc: fixed the year. it is 2014 now :) 388094027 updated docs to reflect recent changes. b4fe8acdd bugfix: when ngx_http_lua_get_co_ctx returns NULL, it no longer means that the coroutine is dead. 5581dedcb added a test to exercise the bug in nginx's resolver that domain names with a trailing dot is rejected. c27f65b2b updated tests to reflect the changes in commit 60999efe3. 60999efe3 bugfix: segmentation fault might happen when the downstream cosocket objects were GC'd. this regression had appeared in commit e768e151ab3. 2444f32db ngx.shared: improved the error handling in incr() a bit. e768e151a bugfix: segfault might happen when aborting a "light thread" pending on downstream cosocket writes. thanks Aviram Cohen for the report. 594830073 ngx.re: added the whole regex flags string to the error message when there is an unknown regex flag. b8efc2749 added a (passing) test for error status to improve code coverage. 01f3cef14 reindexed the test file 043-shdict.t. f6d309ffd shdict: improved the error handling a bit and also added more (passing) tests. 5bf928ede ngx.var: added a (passing) test for writing to a non-changeable nginx variable. c3d8da376 ngx.var: improved the error handling a bit. 4c1d0bd10 feature: ngx.escape_uri() and ngx.unescape_uri() now accept a nil argument, which is equivalent to an empty string. a4323aab8 shdict: improved the error handling a bit and also increased the tests' code coverage. 0afaeec3d added (passing) tests for using lua numbers in response header names and values for the ngx.header.HEADER API. 76fc8a7c8 feature: added new pure C API, ngx_http_lua_ffi_max_regex_cache_size, for FFI-based implementations like lua-resty-core. dce53afc6 feature: added the optional 5th argument to ngx.re.match() which is the user-supplied result table for the captures. ed3e68fc0 added a (passing) test for providing the resulting match table to ngx.re.match(). 73d74a094 added (passing) tests for feeding lua numbers to ngx.md5(), ngx.md5_bin(), and ngx.sha1_bin(). 2d0f587ec ngx_http_lua_ffi_set_ctx_ref: return the error code NGX_HTTP_LUA_FFI_NO_REQ_CTX properly. 52dfc3fbf refactor: avoided the magic error code -3 in ngx_http_lua_ffi_get_ctx_ref. 7e7b944ad change: ngx.decode_base64() now only accepts string arguments. fc52e157e Merge pull request #322 from zh-ang/master 1b96235e5 reduce compiling warning(avoid halting compiling) c50f3cd3c doc: documented that the coroutine.* API can be used in init_by_lua since 0.9.2. thanks Ruoshan Huang for the reminder. 26c1accef tweaked a test case that could fail randomly on slow machines. eafad2990 bugfix: we did not set the shortcut fields in r->headers_in for request headers in our subrequests created by ngx.location.capture*(). thanks Aviram Cohen for the original patch in #318. f64993565 optimize: we no longer clear the lua_State pointers for dead "light threads" such that their coroutine context structs could be reused by other "light threads" and user coroutines. 8f4c48532 bugfix: coroutines might incorrectly enter the "dead" state even right after creation with coroutine.create(). thanks James Hurst for the report. 8d1459812 minor debugging log tweaks. 80c8bc0aa reindexed test file t/041-header-filter.t. 3f8a592ac feature: allow use of ngx.exit() in the context of header_filter_by_lua*. but in this context ngx.exit() returns immediately. 9b76f74de updated the tests to reflect recent changes in ngx.exit(). f364c8203 fixed incompatiblities in nginx 1.5.8 which breaks the resolver API in the nginx core. 5a4199bb9 bugfix: we might try sending the response header again in ngx.exit() when the header was already sent. 20c41e1ad version bump. 779702a17 fixed issues in the test suite exposed by nginx 1.5.7. 0787f2c2a fixed the tests for truncated subrequests to reflect the changes in nginx 1.5.3+. 685f5eaf7 bugfix: subrequests initiated by ngx.location.capture() might send their own response headers more than once. this issue might also lead to the alert message "header already sent" and request aborts when nginx 1.5.4+ was used. 4f2b35ddb doc: bumped version to 0.9.3 and also stated that we work with nginx 1.4.4. 31e221279 doc: documented the new behavior regarding zero-delay timers upon nginx worker process exiting. 6e4a22b52 doc: documented the ngx.worker.exiting() API. 3c5e109e3 bugfix: ngx.req.set_header() did not completely override the existing request header with multiple values. thanks Aviram Cohen for the report in #314. 0b9558cb1 bugfix: fixed compilation warnings when ngx_devel_kit is missing in the build. 02abcec8a doc: minor formatting fixes in the markdown version. d11dda108 added test cases for commit 2a121317. 04a7a2cca use Test::Nginx::Socket::Lua from the test-nginx project in our test suite. de86661c6 fixed the test plan in 025-codecache.t. af1b72ec1 bugfix: when lua_code_cache was off and timers created by ngx.timer.at() was exceeding the lua_max_running_timers limit, memory leak would happen. this bug had appeared in the new per-request Lua VM refactoring. 1de82ab6e bugfix: memory leak would happen in the pure C API function ngx_http_lua_ffi_destroy_regex for FFI-based ngx.re implementations. 2a121317d bugfix: when lua_code_cache is off, per-request Lua VMs should inherit package.path and package.cpath from the global Lua VM because the LUA_PATH and LUA_CPATH environments might not be inherited by nginx worker processes. thanks leaf corcoran for the report. 182042386 refactor: introduced the type ngx_http_lua_ffi_str_t for FFI-based APIs. 5ed4aa8b8 bugfix: modifying request headers in a subrequest could lead to assertion failures and crashes. thanks leaf corcoran for the report and test cases. d37d7475f refactor: removed the useless "conf" field from ngx_http_lua_socket_pool_t. 69b0e98dc refactor: cleaned up the code for Lua VM instance management. f61d7ba10 bugfix: turning off lua_code_cache and using cosocket connection pools might lead to memory issues (like segfaults). this regression had appeared in commit 5fc80b5b0. thanks Zheng Ping for the report. 77fb07257 better debugging logs for "lua_code_cache off" and better test cases. 4eade0689 doc: tweaked the wording for lua_code_cache a bit more. 26e148a0a removed an unimportant subtest from 025-codecache.t. 80944815a doc: updated the docs for lua_code_cache to reflect recent changes. 9a9c511fe added more tests for "lua_code_cache off". 250ab0892 added more debugging logs to the (global) Lua VM instance managing code. 5fc80b5b0 bugfix: turning off lua_code_cache could lead to memory issues (segfaults and LuaJIT assertion failures) when Lua libraries using LuaJIT FFI were loaded. now we always create clean separate lua VM instances for every Nginx request when the Lua code cache is disabled. thanks Ron Gomes for the report. 8acecfef6 refactor: introduce the ngx_http_lua_get_main_lua_state function to abstract away where the global lua state is stored. f07a73ef5 refactor: made the main Lua VM state creation and initialization code detached from the configuration loading phase. bb9b2b341 feature: added pure C API for FFI-based implementations of the ngx.header.HEADER API (the write part). d87ded2fe fixed an issue in commit 8e6b4e3cb7: cygwin linker only issues a warning about the use of -E rather than an error, so our previous feature test for -E always succeeds. thanks Heero Zhang for the report. 9dd88ffcd bugfix: fixed compiler warnings and errors when using the Microsoft Visual C++ compiler. thanks Edwin Cleton for the report. 5a9a6f1cc feature: added pure C API functions for FFI-based implementations for ngx.req.get_uri_args(). 8e6b4e3cb bugfix: the linker option -E is not support in Cygwin's linker; we should test --export-all-symbols when -E is unavailable. thanks Heero Zhang for the report. 5d7e08ce0 documented the new "nth" argument for ngx.re.find. 6213b040c bugfix: ngx.re.find: fixed the case when "nth" is greater than or equal to "rc" but not exceeds the number of captures. a8c0b5f2b bugfix: ngx.re.find: we incorrectly returned negative indexes for nil submatch captures; also we returned the "nth out of bound" when there was a trailing nil submatch capture. 27b804d4c bugfix: ngx.re.find() did not return an error when the "nth" argument is out of bound. 55adcc6b0 feature: ngx.re.find() now accepts the optional 5th argument "nth" to control which submatch capture's indexes are returned. thanks Lance Li for the feature request in agentzh/lua-resty-core#1. 590ac5c94 updated the test suite to reflect recent changes in Test::Nginx. 5e0db0e9a fixed the "ngx" table preallocation space. 014de9d9b doc: typo fix from Zheng Ping. 77f24ba4a fixed a test case in t/014-bugs.t. 513051779 bugfix: 0-delay timers created after the worker starts shutting down should not always expire prematurely. 002b68ec7 feature: added new API function ngx.worker.exiting() for testing if the current worker process is exiting. 4d6dc5804 feature: allow creating 0-delay timers upon worker process existing. e5f63816b doc: more formatting tweaks. 55623aca7 doc: fixed regressions in the markdown version. f5b78fc80 doc: markdown: removed unnecessary indentation from code samples. 159be4c9b doc: documented how to link against a static library (or object file archive) consisting of (many) compiled Lua module files. 736fce1ad doc: added new section "Statically Linking Pure Lua Modules". 5cb9d9d48 doc: mention LuaJIT 2.1 wherever we mention LuaJIT 2.0. 98f9420bf added ljson.lua for the test suite so that we can have sorted keys in the JSON encoded output. 9401a60cb fixed the table pre-allocation space for the ngx.config table. 86a08bab4 documented the new ngx.config.nginx_version and ngx.config.ngx_lua_version API. 797fa5cac feature: added new API for version numbers of both nginx and the ngx_lua module itself: ngx.config.nginx_version and ngx.config.ngx_lua_version. thanks smallfish for the patch. 3748896d6 minor debugging log message tweaks. e4e085f73 Merge branch 'master' into ffi 93bc3c505 updated docs to reflect the new support for loading LuaJIT 2.1 bytecode directly. 358f9a590 feature: added support for loading LuaJIT 2.1 bytecode files directly in *_by_lua_file directives. 11dee4a44 feature: added pure C API for FFI-based implementations of ngx.req.get_headers. 3e63ceba3 feature: added pure C API for FFI-based implementations for storing operations in the shared dictionaries. 6e0a5c528 bugfix: the FFI API for ngx.var incorrectly used the storage of the input buffer. 15e53e3a1 Merge branch 'master' into ffi 1523ab0ac removed the plain text README file. 622f12aad feature: added pure C API for implementing ngx.var writes via LuaJIT FFI. 6c1e4d621 optimized the default implementation of ngx.headers_sent a bit. 97d6a8c94 feature: added pure C API for FFI-based implementations of ngx.headers_sent. 12920fffb feature: added pure C API for FFI-based implementations of ngx.is_subrequest. a7a41fd0c feature: added pure C API for FFI-based API for ngx.status. 7358557db feature: added pure C API for FFI-based implementations of ngx.ctx. 7b9d88656 Merge branch 'master' into ffi d516e4e31 bumped version to 0.9.2. 229a22142 documented the new ngx.config.prefix() API function. 8228e9844 bugfix: reading ngx.header.HEADER could result in Lua string corruptions. thanks Dane Knecht for the report. 1bedc5d4c ngx.re.find now returns a single nil value when no match is found. 2d6cf5c7f documented the new ngx.re.find API function. d577a63e8 merged branch "master" into "ffi". 87dd3cf15 updated valgrind.suppress a bit. e454b0b1c Merge branch 'master' into ffi a44298037 updated .gitignore a bit. e6db9d3ae added tests for ngx.re.find. 279da4d09 feature: added new API function ngx.re.find, which is similar to ngx.re.match, but only returns the beginning index and end index of the whole match. 91d701d19 updated tests to reflect the fix in commit ccb0cbe0d. d333a369e minor coding style fixes. f5944933b updated docs to reflect recent changes. ccb0cbe0d bugfix: ngx.re.match: the ctx table's "pos" field should start from 1 instead of 0. 8fe00e8fc fixed a test title. 3c0a9d90b add debugging logs for the Lua VM initialization and shutdown. 0c85bec1b removed valgrind suppression rules for LuaJIT. f4af449f6 updated valgrind.suppress when the sysmalloc is used. 93493ea7d no longer set RPATH for luajit lib in the developer build script; also updated valgrind.suppress for luajit using system malloc. 0bd56bb8c updated valgrind.suppress when the sysmalloc is used. 483a3a9d7 no longer set RPATH for luajit lib in the developer build script; also updated valgrind.suppress for luajit using system malloc. df91a47b6 bugfix: compilation errors with nginx older than 1.0.0. 642db29e5 Merge branch 'master' into ffi 22f4c67a1 fixed the test plan for 119-config-prefix.t. 5536b8540 merged branch "master" to "ffi". 014c6b51b bugfix: localizing the coroutine.* API functions in init_by_lua* for future use in contexts like content_by_lua* might hang the Lua code. thanks James Hurst for the report in #304. cd52bd369 feature: added new API function ngx.config.prefix() to return the nginx server prefix path. c99ebeb4d documented the new lua_use_default_type directive. a95851bb1 doc: updated the docs for ngx.req.socket(raw) to reflect the recent change that allows reading raw request body data directly. b6715395c doc: bumped version to 0.9.1; also added a new section "System Environment Variable Support". 594f55bcb added a test case to exercise a bug in ngx_gunzip module with which ngx.flush(true) could hang forever. thanks Maxim Dounin for the catch. to make this test pass, we need the gzip_flush_bug patch applied to the nginx core. 4615fd591 bugfix: use of ngx.exit() to abort pending subrequests in other "light threads" might lead to segfault or request hang when HTTP 1.0 full buffering is in effect. 4ec0347d9 Merge branch 'master' into ffi b1ec27548 optimize: made ngx.re.match and ngx.re.gmatch faster for LuaJIT 2.x when there is no submatch captures. 9f134736c added a test for accessing $proxy_host and $proxy_port in Lua. this test requires the proxy_host_port_vars patch for the nginx core to pass. thanks saravsars for the report in #301. b361a101f updated valgrind.suppress to reflect recent changes. db87600eb doc: added language syntax highlighting to the markdown version. 647706f5b added a test case that exercises a bug in nginx's cache lock, which could lead to infinite request hang when cache_lock_timeout is exceeded. this test requires the cache_lock_hang_in_subreq patch to pass. thanks Akos Gyimesi for the report in #298. a8396e505 bugfix: downstream write events might interfere with upstream cosockets that are slow to write to. thanks Aviram Cohen for the report. 1f65751fc bugfix: removing a request header might lead to memory corruptions. thanks Bjørnar Ness for the report. 82ba941d2 bugfix: reading the value of ngx.status might get different values than ngx.var.status. thanks Kevin Burke for the report. 1c0a9e831 added a test for using ngx.flush(true) with the standard ngx_gzip module. it could hang in mainline nginx cores older than 1.5.3. 350e38a34 bugfix: the bookkeeping state for already-freed user threads might be incorrectly used by newly-created threads that are completely different. thanks Sam Lawrence for the report. 0f3c249a9 bugfix: calling ngx.thread.wait() on a user thread object that is already waited (i.e., already dead) would hang forever. thanks Sam Lawrence for the report. dad8ba3ab doc: fixed the context for the lua_package_path and lua_package_cpath directives. thanks duhoobo for the report in #297. 22ba5b114 fixed the test plan in 082-body-filter.t. 9e39cfd62 bugfix: the alert "zero size buf" could be logged when assigning an empty Lua string ("") to ngx.arg[1] in body_filter_by_lua*. 9bae5adf3 refactor: eliminated introducing NULL chain link in body_filter_by_lua*, which simplied the implementation a lot. 45319bfe5 doc: markdown: added lots of "Back to TOC" links to each sections but the beginning ones. 71d42c6d9 doc: markdown: added a "Table of Contents". b22569669 docs: markdown: made the module name more readable. d8c8e86c0 docs: markdown: fixed more external links that still point to wiki.nginx.org. f026151f0 docs: markdown: fixed links that were pointing to wiki.nginx.org, wherever possible. 70ecf928f docs: fixed the links in the markdown source. now they no longer point to the (broken) nginx wiki site. 82cbbd833 bugfix: subrequests initiated by ngx.location.capture* could trigger unnecessary response header sending actions in the subrequest because our capturing output header filter did not set "r->header_sent". f17fc0941 bugfix: the Lua error when ngx.sleep() was used in log_by_lua* was not friendly. thanks Jiale Zhi for the report. 39ac6421a bugfix: ngx.req.set_header("Host", value) would overwrite the value of $host with bad values. thanks aviramc for the patch in #293 (and issue #292). 335ad8cc9 added a code comment regarding the "active_connections" field in ngx_http_lua_socket_pool_t. b41f546c7 fixed the preallocation size for the "coroutine" Lua table. 9a986c9f9 Merge branch 'master' into ffi ca90ef434 optimize: pre-allocate space for the resulting Lua tables in ngx.location.capture*. 054444dd4 optimize: preallocate some space in our Lua registry tables to reduce the initial requests' "warm-up" time a bit. 0b3c47a3b optimize: preallocate the space for the metatable for the global environment table for header_filter_by_lua*, body_filter_by_lua*, and log_by_lua*. 101f8d9ed optimize: preallocate 4 hashtable slots in the ngx.ctx tables. ace93e66f optimize: preallocate space for the "ngx.thread" lua table during API initialization. d7e8ff8ca resolved a merge conflict. 136087f32 optimize: preallocate space for the "coroutine" lua table. bc8496447 optimize: preallocate space for the "coroutine" lua table. 330fe6e59 merged "master" into "ffi". c304f3592 bugfix: when there were no existing Cache-Control response headers, "ngx.header.cache_control = nil" would (incorrectly) create a new Cache-Control header with an empty value. thanks jinglong for the patch. 01bf02aa0 bugfix: the original lettercase of the header name was lost when creating the Cache-Control response header via the ngx.header.HEADER API. 487618a80 bugfix: header_filter_by_lua*, body_filter_by_lua*, and ngx.location.capture* might not work properly with multiple http {} blocks in nginx.conf. thanks flygoast for the report in #294. bc43c4367 docs: added more explanation on subrequests' request body handling. thanks Jędrzej Nowak for the suggestion. cd669b556 made a test case in 024-access/client-abort.t less possible to fail due to timing errors. fc03bfec3 bugfix: now ngx.req.socket(raw) returns proper error when there is some other "light thread" reading the request body. ebf9cc867 feature: now the raw request cosocket returned by ngx.req.socket() no longer requires the request body to be read already, which means that one can use this cosocket to read the raw request body data as well. thanks aviramc for the original patch. 374096296 added tests for the new lua_use_default_type directive. e5d47c448 bugfix: we always printed the "lua hit request header limit" debug log message even when the limit is not hit at all. this regression had appeared in commit d8a266497a. 789e36b49 feature: added the new configuration directive "lua_use_default_type" for controlling whether to send out a default Content-Type response header (as defined by the "default_type" directive). default on. thanks aviramc for the patch in #286. d8a266497 optimize: now we pre-calculate the exact size of the resulting Lua table and preallocate the table space, which makes it 8%+ faster for a request with a dozen request headers and 40%+ faster for a hundred request headers. f99825624 reindexed the 025-codecache.t test file. 2063a94b2 docs: bumped version to 0.9.0 and mentioned lua-resty-websocket and lua-resty-lock. eabadd9b2 docs: documented the new ngx.req.socket(true) API, upon which fancy protocols like WebSocket can be implemented. 04e53ee37 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. 8e6c9a312 change: raised the "lua_code_cache is off" warning to an alert. c4657a35b feature: now we allow use the raw request cosocket returned by ngx.req.socket(true) to send the raw HTTP response header. thanks aviramc for requesting this in #242. also we now always enable "lingering close" in the nginx core when raw req sockets are used. 42567bd24 docs: made the "Test Suite" section up to date (I hope). 7720bc7d9 removed the ngx_upstream_keepalive module from the developer build script because it has been included in the official nginx distribution. 5dfd54714 tests: removed the "single" option from the "keepalive" directive because it is not a public feature. 095ed4a23 bugfix: compilation regressions with nginx older than 1.3.13, introduced recently by the ngx.req.socket(true) API. 0387a89e7 bugfix: Windows compatibility issue in the Lua/LuaJIT bytecode file loader: it assumed that ngx_fd_info accepts integral fd as the 1st argument. thanks Edwin Cleton for the report (#283) and thanks jinglong for the original patch in #284. a41567b64 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. c6b6b315d more warning fixes for the Microsoft Visual C++ compiler. thanks Edwin Cleton for the report. 585e7af92 bugfix: fixed most of the compiler warnings from the MinGW C compiler, some of which are real overflow issues. thanks Edwin Cleton for the report. 33832b1f7 fixed bad request header lines in the tests in 116-raw-req-socket.t, which caused test bailout in the "check leak" testing mode. a0ff19221 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. 19f6f2f36 Merge branch 'master' into websocket add6df63b Merge branch 'master' into ffi e78dea9e0 bumped version to 0.8.10. 1d4c76d17 bugfix: we did not declare the "level" local variable of ngx_http_lua_ngx_log at the beginning of the code block. thanks Edwin Cleton for the report. db35efd18 docs: documented more limitations in the current implementation. a98ff5f80 docs: avoided using module() and also recommended the lua-releng tool to locate misuse of Lua globals. c218ed706 testing: fixed the stap probes for the new ffi implementation. 8fdfc7983 bugfix: use of the ctx->headers_sent field that was already removed. ca27b9e36 Merge branch 'master' into ffi 6597dc591 Merge branch 'master' into websocket a641101a5 bumped version to 0.8.9. 235875b5c refactor: removed our own ctx->headers_sent field because we should used r->header_sent instead. 4256020e4 Merge branch 'master' into websocket 95e293160 bugfix: the "pool" option value could not be nil in tcpsock:connect(). 7b726b32c change: we now temporarily disable the Lua API functions ngx.location.capture, ngx.location.capture_multi, and ngx.req.socket that are known to have problems with the SPDY requests for now. we will fix them eventually in the near future. 0557e44aa Merge branch 'master' into websocket 22e09118b bugfix: the nginx core does not send a default status line for 101 status code. now we construct one for 101. 8bbd6aae2 bugfix: the nginx core does not send a default status line for 101 status code. now we construct one for 101. 876beeef5 Merge remote-tracking branch 'origin/master' into websocket 36157b4cd bugfix: tcpsock:receive(0) could hang when no data arrived; now it always returns an empty string immediately. this new behavior diverges from LuaSocket though. aa2104931 Merge remote-tracking branch 'origin/master' into websocket 38ebe9a31 bugfix: we did not honor the tcp_nodelay config directive in the raw downstream cosockets. 5b7c567cb documented the "always_forward_body" option for ngx.location.capture() and ngx.location.capture_multi(). 4c6dc4f7a updated docs to reflect recent changes. 410930fa3 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. 55776b7b5 tests: use larger timeout settings to account for slow DNS servers. ba7c1766b fixed those recently-added test cases that could fail in slow testing modes on slow machines. 0f7948d52 bugfix: we did not escape \z, \t, and \b properly in ngx.quote_sql_str(). 6e4b5745a bugfix: the null character ('\0') was not escaped in ngx.quote_sql_str() according to the MySQL quoting rules. thanks Siddon Tang for the report. fe3c318fa change: we now limit the number of nested coroutines in the backtrace dump for uncaught Lua exceptions by 5. 7c5e3548a 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. now we just dump the top 22 levels in the backtrace for simplicity. also optimized the Lua string concatenation operations when constructing the backtrace string. 2926596a2 feature: now timeout errors in tcpsock:receive() and the reader returned by tcpsock:receiveuntil() no longer close the current cosocket object automatically. thanks Aviram Cohen for the original patch. 1a9f044dc now we allow application of the mockeagain reading mode to the test files that require the mockegain writing mode. 438bbca78 added a (passing) test for recalling the send() method on the same tcp cosocket object right after a send timeout error happens. 75d2524ba added a (passing) test for recalling the connect() method on the same tcp cosocket object right after a connecting timed out error happens. 45f430a00 feature: added new option "always_forward_body" to ngx.location.capture(), which controls whether to always forward the parent request's request body to the subrequest. 9d5bb2aa5 refactor: made the "processing flushing coroutines" process a separate C function. 37a502108 minor code refactoring to make the ngx_http_lua_wev_handler function shorter. 29a253b55 Revert "bugfix: ngx.flush(true) might hang when there was a buggy output body filter. now we only test the condition "r->connection->buffered & NGX_LOWLEVEL_BUFFERED"." 4ed6e7a54 bugfix: ngx.flush(true) might hang when there was a buggy output body filter. now we only test the condition "r->connection->buffered & NGX_LOWLEVEL_BUFFERED". 539a3021f one minor optimization in ngx.req.socket(). 138bc9d91 documented the new ngx.config.debug API and also updated docs to reflect other recent changes. db7a8c90c feature: added new FFI C API function ngx_http_lua_ffi_var_get for reading ngx.var.VARIABLE. b6d19752e feature: added new FFI C API ngx_http_lua_ffi_shdict_incr for shdict:incr(). 6473e2242 minor coding style fixes. e7f3b0264 feature: added new FFI C API for shdict:get(). also we use double instead of lua_Number when storing Lua numbers into shdict. b68729345 bugfix: the FFI C API function ngx_http_lua_ffi_compile_regex could leak memory when pcre failed to compile the regex pattern argument. d9400dc43 skipped the regex tests for checking bad data types, which cannot pass with lua-resty-core. 6227668ef bugfix: the FFI version of the PCRE API did not generate debug logs indicating the result of PCRE JIT compilation. 65010dd09 feature: added support for lua_regex_match_limit in the FFI C API function for PCRE. 527009f21 Merge remote-tracking branch 'origin/master' into ffi c75204927 optimize: fixed the initial table sizes for "ngx", "ngx.config", and "ngx.re". 9577e5fc5 feature: added new API ngx.config.debug to indicate whether this is a debug build of nginx. 021645c5e Merge remote-tracking branch 'origin/master' into ffi fdec27035 fixed test cases that tried to send the response header twice, which were caught by nginx 1.5.4. 3e049c594 minor cleanup in a recently added test case. 1e13a16b3 minor refactoring in the closure factory. c9a04a9c2 bugfix: when a Lua line comment was used in the last line of the inlined Lua code chunk, a bogus Lua syntax error would be thrown. d9a48d86c bugfix: the error message for failures in loading inlined Lua code was misleading. a0343434b bugfix: ngx.exit(204) could try to send the response header for twice. nginx 1.5.4 caught this issue. f4c4667b5 fixed a potential test failure in a recently added test case in 025-codecache.t. 3abd78b2f Merge branch 'master' into ffi e549fc2df feature: log_by_lua now always runs before the standard ngx_http_log_module (for access logging). thanks Calin Don for the suggestion in #254. 334afb35d fixed a test case index number in 025-codecache.t. b3734f002 bugfix: the global Lua state's _G table was cleared when lua_code_cache was off, which could confuse the setup in init_by_lua. thanks Robert Andrew Ditthardt for the report in #257. 4042f7bd6 bugfix: ngx.flush() triggered response header sending when the header was not sent yet. now it just returned the error string "nothing to flush" for this case. thanks linbo liao for the report. 940429a5c bumped version to 0.8.6. 2db5028ad bugfix: segfaults would happen in ngx.req.set_header() and ngx.req.clear_header() for HTTP 0.9 requests. thanks Bin Wang for the report in agentzh/headers-more-nginx-module#14. 65d4b419b minor test fixes. e72ab1dba minor coding style fixes. c7237efd8 made the test for shdict:get_stale less possible to fail. 7dbd2a511 bugfix: reading ngx.header.location did not work when auto-redirect was in action. this is a further fix for #260. 547d29946 bugfix: segfault might happen when reading or writing to a response header via the ngx.header.HEADER API in the case that the nginx core initiated a 301 redirect. this issue was caused by an optimization in the nginx core where ngx_http_core_find_config_phase, for example, does not fully initialize the "Location" response header after creating the header. thanks Vladimir Protasov for the report in #260. e0626c312 added tests to improve the code coverage in file ngx_http_lua_headers_out.c. 87a4f346b documented the new "get_stale" method for shdict objects. 424232deb updated docs to reflect recent changes. 124f50fd4 feature: added new method "get_stale" to shared dict objects, which returns the value (if not freed yet) even if the key has already expired. thanks Matthieu Tourne for the patch in #249. 2f5ebebcd bugfix: the "connect() failed" error message was still logged even when lua_socket_log_errors was off. thanks Dong Fang Fan for the report. 52f48e076 bugfix: we incorrectly returned 500 in our output header filter, body filter, and log-phase handlers upon inlined Lua code loading errors. bugfix: Lua stack overflow might happen when we failed to load inlined Lua code from the code cache. c7a52824a more coding style fixes. abaa7f427 more coding style fixes. e4641a3c7 more coding style fixes. 5edc4b3fc one minor coding style fix. thanks Guanlan Dai. c6426fb5e fixed the test plan in t/033-ctx.t. 0aa9332f5 bugfix: we incorrectly returned 500 in our output header filter, body filter, and log-phase handlers upon errors. bugfix: Lua stack overflow might happen when we failed to load Lua code from the code cache. 629330431 bugfix: memory leak would happen when using ngx.ctx before another nginx module (other than ngx_lua) initiates an internal redirect. 32aadb76d fixed a test case. e24ffb751 bugfix: use of the ngx.ctx table in the context of ngx.timer callbacks would leak memory. ffe89f226 refactor: abstracted the ngx.ctx releasing logic to eliminate code duplication. 00c5fb411 one minor coding style fix. 6859f6f8b minor error message fixes in the Lua code cache. 197332049 added a (passing) test for using .lua files with a shebang line in the content_by_lua_file directive. d1c654b3e bugfix: the error message was misleading when the *_by_lua_file directives failed to load the Lua file specified. fb38e4b27 various coding style fixes in the closure factory. 1db1e71f1 refactor: removed the useless code for reading Lua code from stdin. fadd28a11 Merge branch 'master' of github.com:chaoslawful/lua-nginx-module 918f9a239 refactor: removed the unused C function ngx_http_lua_clfactory_loadstring. df35583dd Merge pull request #262 from cubicdaiya/issues/traditional_definition 60902726d give the argument of 'void' to function definitions which has no arguments eecb52bc4 bugfix: when our atpanic handler for Lua VM gets called, the Lua VM is not recoverable for future use. so now we try to quit the current nginx worker gracefully so that the nginx master can spawn a new one. 0d8143091 bumped version to 0.8.5. 4516e5adf docs: documented the memory freeing behavior of shdict:flush_all and shdict:flush_expired. f36a35d39 documented the lua_regex_match_limit directive. 9d017a21e feature: added new directive lua_regex_match_limit for setting PCRE match_limit for regex matching. 0aca2046f bugfix: when compiling with -DDDEBUG=1, there was a compilation error in ngx_http_lua_uthread.c. thanks tigeryang for the report in #259. 8708f604f docs: typo fixes in the code sample for body_filter_by_lua. thanks cyberty for reporting this issue as #261. fe467e52b bugfix: the ngx.ctx tables would leak memory when ngx.ctx, ngx.exec()/ngx.req.set_uri(uri, true), and log_by_lua were used together in a single location. thanks Guanlan Dai for writing the gdb utils to catch this. a184a9111 util/build2.sh: default to nginx 1.4.1 now. 76c2427ac test: made the resolver less possible to time out in two test cases. 4656a290b docs: bumped version to 0.8.4; also mentioned Nginx Systemtap Toolkit. 4d27348cc bugfix: tcpsock:send("") resulted in the error log alert message "send() returned zero". 6977e9518 bugfix: setting ngx.var.VARIABLE could lead to stack buffer over-read in luaL_error when an error happened. 25ef1f942 feature: added pure C API for ngx.exit, which is expected to be used with LuaJIT FFI (or lua-resty-core in particular). also added coroutine._yield for the original std version of coroutine.yield. d86d3dc6f Merge remote-tracking branch 'origin/master' into ffi 5e256f8bf refactor: now we store the nginx request object as a named Lua global variable __ngx_req to help FFI-based Lua code access it. d82196f7f bugfix: t::TestNginxLua: env TEST_NGINX_INIT_BY_LUA would break existing init_by_lua_file directive in the test case. 0e5d1a892 Merge branch 'master' into ffi 569cabe17 refactor: no longer store cf->log into the lua registry table because we can directly access the global ngx_cycle->log thing. d9e3e8fee refactor: added inline functions ngx_http_lua_get_req and ngx_http_lua_set_req to eliminate code duplication when storing or fetching the nginx request object from the lua global variable table. fe27fc2a4 updated README.markdown to reflect recent changes in docs. f05ef37b9 optimize: avoided use of the nginx request objects in ngx.encode_args. 5a0bb76e6 optimize: avoided use of the nginx request objects in ngx.escape_uri, ngx.unescape_uri, ngx.quote_sql_str, ngx.decode_base64, ngx.encode_base64, and ngx.decode_args. 488ab67c0 Merge branch 'master' into ffi d8aa2feda updated docs to reflect recent changes. ff9580dd3 bugfix: ngx.flush(true) might not return 1 on success. 5a880aea9 change: made ngx.say/ngx.print/ngx.eof/ngx.flush/ngx.send_headers return nil and a string describing the error in case of most of the common errors (instead of throwing out an exception), and return 1 for success. cf4f62a62 updated .gitignore a bit. b07a3d3c5 fixed failing test cases to reflect the multi-value header change in nginx 1.4.1. f40a50427 tests: replaced the domain name "direct.agentzh.org" with "agentzh.org". 34f4042f2 Revert "bugfix: use of LuaJIT FFI when disabling the Lua code cache would lead to LuaJIT GC assertion failures like "g->gc.total == sizeof(GG_State)" because we unloaded the standard "ffi" module. thanks Ron Gomes for reporting this issue." b3218be26 bugfix: use of LuaJIT FFI when disabling the Lua code cache would lead to LuaJIT GC assertion failures like "g->gc.total == sizeof(GG_State)" because we unloaded the standard "ffi" module. thanks Ron Gomes for reporting this issue. 48067c830 feature: added pure C API for ngx.re.sub and ngx.re.gsub, which is expected to be used by lua-resty-core and etc. ef8779b18 Merge remote-tracking branch 'origin/master' into ffi 39151875d updated docs to reflect recent changes. 63a9915d3 added (passing) tests for use of the $invalid_referer variable in Lua. this requires the patch invalid_referer_hash for the nginx core (for now). thanks Fry-kun for reporting this issue as github #239. f50c7789b bugfix: a test case would fail when TEST_NGINX_PORT was set to port numbers other than 1985. 9e4f9272d Merge remote-tracking branch 'origin/master' into ffi 603c7a479 refactor: made the error messages for replacement template compilation failures less verbose in ngx.re.sub and ngx.re.gsub. 52bc57345 Merge remote-tracking branch 'origin/master' into ffi bd679f20e refactor: save the ngx_log_t pointer instead of the ngx_http_request_t pointer in ngx_http_lua_script_engine_t. this will make the new FFI-based Lua API easier to implement. f20bc6610 added custom test scaffold t::TestNginxLua which subclasses Test::Nginx::Socket. it supports the environment TEST_NGINX_INIT_BY_LUA which can be used to add more custom Lua code to the value of the init_by_lua directive in the nginx configuration. 300b167bd fixed a test that may time out unexpectedly. 5cd82926f bugfix: no longer automatically turn underscores (_) to dashes (-) in header names for ngx.req.set_header and ngx.req.clear_header. thanks aviramc for the report. 9cfcb06ba bugfix: segmentation fault might happen in nginx 1.4.x when calling ngx.req.set_header on the Cookie request headers because recent versions of nginx no longer always initialize r->headers_in.cookies. thanks Rob W for reporting this issue as #237. 06da40f9b style: fixed one line's indentation. 71e16c46d added custom test scaffold t::TestNginxLua which subclasses Test::Nginx::Socket. it supports the environment TEST_NGINX_INIT_BY_LUA which can be used to add more custom Lua code to the value of the init_by_lua directive in the nginx configuration. 1f1a31c7b feature: added pure C API for ngx.re.match, which is expected to be used by lua-resty-core and etc. 170d8f9d7 bugfix: ngx_http_lua_ffi_escape_uri did URI unescaping instead of URI escaping. 1bf2344ca Merge remote-tracking branch 'origin/master' into ffi 31a80431c fixed some expected error messages in the ngx.re test cases for Lua implementations of the ngx_lua API like lua-resty-core. e8ec21e9a Merge remote-tracking branch 'origin/master' into ffi 9b8a7b5e0 change: made more error messages for regex exec failures less verbose. a80d4e1d6 Merge remote-tracking branch 'origin/master' into ffi 5c5a0a87b change: made the error messages for regex exec failures less verbose. ece37a98e Merge remote-tracking branch 'origin/master' into ffi 35e6a65f9 change: made the error messages for regex compilation failures less verbose. 0e9fbdfb7 Merge remote-tracking branch 'origin/master' into ffi 4806fc2ee bugfix: fixed the warning "argument 'nret' might be clobbered by 'longjmp' or 'vfork'" when compiling with Ubuntu 13.04's gcc 4.7.3. thanks jacky and Rajeev's reports. 41e3c2f5b docs: documented the new WebDAV request methods; also fixed a small typo. b4c2ad1f8 feature: added ngx.HTTP_MKCOL, ngx.HTTP_COPY, ngx.HTTP_MOVE, and other WebDAV request method constants; also added corresponding support to ngx.req.set_method and ngx.location.capture. thanks Adallom Roy for the patch. 601ddff37 optimize: ngx.escape_uri now runs faster when the input string contains no special chars to be escaped. b7b728926 bugfix: temporary memory leaks might happen when using ngx.escape_uri, ngx.unescape_uri, ngx.quote_sql_str, ngx.decode_base64, and ngx.encode_base64 in tight Lua loops because we allocated memory in nginx's request memory pool for these methods. f442858bb minor coding style fixes and micro optimizations in ngx.md5, ngx.encode_base64, and ngx.decode_base64. 1cc76f597 feature: allow injecting new APIs into the "ngx" table. c04c51a23 bugfix: ngx.req.set_body_file() always enabled Direct I/O which caused the alert message "fcntl(O_DIRECT) ... Invalid argument" in error logs on file systems lacking the Direct I/O support. buffer corruption might happen in ngx.req.set_body_file() when nginx upstream modules are used later because ngx.req.set_body_file() incorrectly set r->request_body->buf to the in-file buffer which could get reused by ngx_http_upstream for its own purposes. thanks Matthieu Tourne for reporting this issue. 5cb2b4946 feature: added pure C API for ngx.escape_uri and ngx.unescape_uri, which is expected to be used by lua-resty-core and etc. 0ab77f964 feature: added pure C API for ngx.encode_base64 and ngx.decode_base64, which is expected to be used by lua-resty-core and etc. c355f0b5b bugfix: failed to compile when SHA1 support is missing. this regression had appeared in cea321f7f9e2614c9e0932e367d15502507fa7e9. 6ef7cef0d feature: allow injecting new APIs into the "ngx" table. cea321f7f added pure C API for ngx.md5, ngx.md5_bin, ngx.sha1_bin, which is expected to be used with LuaJIT FFI (or lua-resty-core in particular). such API can be excluded by specifying the C macro NGX_HTTP_LUA_NO_FFI_API. 34411875f added error log checks to the bytecode tests. e7dff1b30 updated the docs in plain text and markdown format to reflect recent changes. c558c4347 bumped version to 0.8.1. 04c81b1f8 minor coding style fixes. 65ff8d86d fixed a test case that may behave slighly differently on slow machines. 790a74e04 bugfix: when lua_http10_buffering is on, for HTTP 1.0 requests, ngx.exit(N) would always trigger the nginx's own error pages when N >= 300. thanks Matthieu Tourne for reporting this issue. 3052bcd8a updated .gitignore a bit. f41226883 refactor: removed the unused parameter, "no_create", from the ngx_http_set_header_helper function. 30cbc3307 fixed several places in the header API where we should return NGX_ERROR instead of NGX_HTTP_INTERNAL_SERVER_ERROR. d1eca0c72 fixed one test case's title. 7695a31e0 documented the new "U" regex option for the ngx.re API. 7e515f189 bugfix: modifying the Cookie request headers via ngx.req.set_header or ngx.req.clear_header did not update the Nginx internal data structure, r->headers_in.cookies, at the same time, which might cause issues when reading variables $cookie_COOKIE, for example. thanks Matthieu Tourne for the patch. 0ac676f65 feature: added the "U" regex option to the ngx.re API to mean enabling the UTF-8 matching mode but disabling UTF-8 validity check on the subject strings. thanks Lance Li for the patch in #227. 766563fba one minor coding style fix. b90e7dd1a bugfix: modifying the Via request header with ngx.req.set_header/ngx.req.clear_header did not update the special field r->headers_in.via when the ngx_gzip module was enabled. 97425f8dc bugfix: ngx.req.set_header/ngx.req.clear_header did not update the special field r->headers_in.x_real_ip when the ngx_realip module was enabled. thanks Matthieu Tourne for the patch. a07df6151 bugfix: modifying the Connection request header via ngx.req.set_header or ngx.req.clear_header did not update the special internal flags in the Nginx core, "r->headers_in.connection_type" and "r->headers_in.keep_alive_n". Thanks Matthieu Tourne for the patch. 55555a78a bugfix: modifying the User-Agent request header via ngx.req.set_header or ngx.req.clear_header did not update those special internal flags in the Nginx core, like "r->headers_in.msie6" and "r->headers_in.opera". Thanks Matthieu Tourne for the patch. 2aa12ab3d bumped version to 0.8.0. 656551e61 documented ngx.timer.at, lua_max_pending_timers, lua_max_running_timers, and other recent changes. 6afcc17ff feature: ngx.get_phase() now returns the string "timer" when being invoked within a user callback function for ngx.timer.*. d98a193d4 added a (passing) test for using ndk.set_var.* in the context of ngx.timer callbacks. d997f7401 refactor: replaced "ngx_lua_" with "ngx_http_lua_" in the identifiers used in ngx_http_lua_regex.c. d43a39c59 bugfix: setting ngx.header.etag could not affect other things reading the ETag response header (like the "etag" directive introduced in nginx 1.3.3+). thanks Brian Akins for the patch in #213. e2d299e50 Merge branch 'timer' f081f212d bumped version to 0.7.21. b2ae68b7a merged "master" into "timer". 6717d1153 feature: added support for user arguments to the user callback function specified in ngx.timer.add(); the user callback function has the prototype "function(premature, user_arg1, user_arg2, ...)". 26d679f8d bugfix: ngx.req.raw_header() would return an empty string value when the default header buffer (c->buffer) can hold the request line but not the whole header. thanks KDr2 for reporting this issue in #229. 10edc8cb0 added a passing test for calling ngx.timer.at() after HUP reload. 069f07541 feature: when the nginx worker process is quitting (as in server shutdown or HUP reload), all the pending ngx.timer timers expire immediately and their Lua callbacks get called with a true value as the first argument (to indicate whether it is a premature expiration or not). f820e5476 Merge branch 'master' into timer 4e8c4bfcb bugfix: boolean values in an array table were rejected with the exception "attempt to use boolean as query arg value" while encoding a lua (hash) table as URL arguments. thanks Calin Don for reporting this issue. 5df2ec9fa Merge branch 'master' into timer a414691b8 updated docs to reflect recent changes. 71bf29a2f merged "master" branch to "timer". 7c6484dc2 updated tests to reflect recent changes in the upstream_truncation patch for the nginx core. 59fe204e9 added error log checks in 000--init.t. 4eeb47626 removed too short proxy read timeout settings in two cases that are expected to pass. 9e3b32f90 fixed a test case that might fail in slow testing modes. b408d5be9 feature: ngx.location.capture and ngx.location.capture_multi now return a lua table with the boolean field "truncated", which indicates whether the subrequest response body is truncated. bugfix: we no longer override the subrequest response status code later when error happens. e9f9fdd3a bugfix: request hung when rewrite cycled in ngx.req.set_uri(uri, true) instead of throwing out an error log message and a 500 page properly. thanks Calin Don for the report. 74617ac4c bugfix: the debug log message "lua set uri jump to <uri>" generated by ngx.req.set_uri(uri, true) was wrong for <uri> was the old URI. 8dc910197 tests: made two systemtap-based test cases less possible to fail in slow testing mode. 40bc1bb0f tests: ensure that TEST_NGINX_USE_STAP is unset when TEST_NGINX_USE_HUP is set. 3c6379264 Merge remote-tracking branch 'origin/master' into timer c7a0cf5f2 Merge remote-tracking branch 'origin/master' into timer 2ac8d8943 feature: added new Lua API, ngx.timer.at(time, callback), for defining timers that can run the user callback as a Lua "light thread" (detached from the current request) after the time (in seconds) specified. also added new configure directives lua_max_pending_timers and lua_max_running_timers for limiting the number of pending timers and "running" timers. a352e1fd6 feature: now we allow zero time argument in ngx.sleep(). 66e2ccbfa bugfix: assignment to ngx.status did not take effect when the response status line had already been generated (by ngx_proxy or others). thanks eqiuno for reporting this issue in #221. d4b8c7d84 bumped version to 0.7.19. f203b5f46 ngx.req.raw_header: added a buffer size assertion and two more (passing) tests regarding some special cases. 664d74ed7 bugfix: ngx.req.raw_header() would return the first part of the request body when request body was read before the call. thanks Matthieu Tourne for reporting this issue. bugfix: ngx.req.raw_header() might not work properly in a subrequest. 5193cff29 updated docs to reflect recent changes. c7879f30f raised the error log level back to "warn" for 087-udp-socket.t, which contains test cases that can flush error logs a lot which may lead to timeouts. 168eb3878 typo fixes in the tests for udp cosockets. 357f25d10 added a (passing) test for ensuring the resolver gets shut down properly when it fails to resolve a domain. 84c4d1833 bugfix: ngx.socket.udp: memory leaks or invalid memory accesses might happen when the DNS resolver failed to resolve. 7f94cb208 fixed some test cases which may fail in slow testing modes. 16db13b88 eliminated the use of the cjson library in a recently-added test case. a38ceeb00 optimize: we now use the bind() call to do autobind for datagram unix domain sockets in ngx.socket.udp() on Linux instead of abusing the side effect of SO_PASSCRED. thanks Dirk Feytons for the suggestion. 57e3a3a9f added a test case for github issue #218, which requires the run_posted_requests_in_resolver patch for the nginx core to get passed. dbde4c390 optimize: fixed the initial size of the ngx.shared table and also updated the tests accordingly. 4751625f8 Merge branch 'ngx-re-no-exceptions' 3ad47790e Merge branch 'shdict-safe-store' d52ed6c2a Merge branch 'master' into subreq-body-in-file f4ffb4f93 one minor coding style fix. b582064ec bugfix: when a non-table value was specified for the "args" option in the ngx.location.capture or ngx.location.capture_multi call, memory invalid access might happen, which resulted in garbage data at least. thanks Siddon Tang for reporting this issue. 182f2e08b Merge branch 'master' of github.com:chaoslawful/lua-nginx-module dfc7a4cd7 feature: datagram unix domain sockets created by ngx.socket.udp() can now receive data from the other endpoint via "autobind" on Linux. thanks Dirk Feytons for the patch. d3c549e9f bugfix: (large) in-file request bodies could not be inherited correctly by multiple subrequests issued by ngx.location.capture. thanks Matthieu Tourne for reporting this issue. 0c8fb04d6 one minor coding style fix. 3ea32c969 api-change: the ngx.re.match, ngx.re.gmatch, ngx.re.sub, and ngx.re.gsub functions used to throw Lua exceptions aggressively for all the error conditions; now they return an additonal string describing the error for almost all common errors instead of throwing exceptions, including pcre compile-time and exec-time failures. thanks Matthieu Tourne for requesting this change. 17b349e97 feature: added new methods safe_set and safe_get to ngx.shared.DICT objects, which never override existing unexpired items but immediately return nil and a "no memory" string message when running out of storage. thanks Matthieu Tourne for requesting this. 835aea95f bugfix: invalid memory access might happen when the UDP cosockets were used. this regression had appeared in the commit f84ca22c30091c75955d44bd790a714b1ef0bbe9. a62eadd49 bugfix: invalid memory access might happen when the TCP cosockets were used. this regression had appeared in the commit 04775502b2e348181282345320b727ab1a5a8808. 5c4c4e429 tests: avoided using taobao.com in the test suite; also decreased the resolver_timeout setting. f84ca22c3 bugfix: when the Lua code using UDP cosockets + resolver was run in a subrequest, the subrequest could hang due to missing calls to ngx_http_run_posted_requests in the UDP cosocket resolver handler. thanks Lanshun Zhou for reporting this issue in #215. 04775502b bugfix: when the Lua code using TCP cosockets + resolver was run in a subrequest, the subrequest could hang due to missing calls to ngx_http_run_posted_requests in the TCP cosocket resolver handler. thanks Lanshun Zhou for reporting this issue in #215. a768a65b2 updated docs to reflect recent changes; also bumped the version number to 0.7.17. 88b4fda41 fixed the timeout settings for large header test cases in 104-req-raw-header.t. d86bb1713 bugfix: rewrite_by_lua_no_postpone can only work globally and did not reject contexts like "server" and "location" configuration blocks. thanks Matthieu Tourne for reporting this issue. ba594765f fixed ill-formed HTTP requests in a recently-added test case, which caused issues under the "check leaks" testing mode. 545b03fd5 fixed tests to reflect output format changes in agentzh/echo-nginx-module@2adcf59ec5. cf568da59 fixed tests to reflect the typo fix in 4927e75b0507477f425a7296cf44119453363b2d. 53a46aaef docs: made it explicit that redirecting to external domains is also supported in ngx.redirect(). thanks Ron Gomes for asking. c95456c87 feature: implemented the ngx.req.raw_header() function for returning the original raw HTTP protocol header string received by Nginx. thanks Matthieu Tourne for requesting this. 4927e75b0 fixed a typo in an error message. thanks Matthieu Tourne for reporting it. 89861df1c feature: implemented ngx.req.http_version() that returns the HTTP version number for the current request. thanks Matthieu Tourne for requesting this. 5361c9529 bugfix: ngx.req.get_headers(limit, true) would still return header names in the all-lower-case form when the "limit" argument was an integer. thanks Matthieu Tourne for reporting this issue. 76910a32d fixed tests that may fail in slow testing modes. eff99d5db bugfix: use of ngx.req.socket() could make socket reading hang infinitely when the request did not take a request body at all (that is, when the Content-Length request header is missing). thanks Matthieu Tourne for reporting this issue. 40fabb23b bugfix: ngx.re.match: when the "D" regex option was specified, an empty Lua table would always be created even when the named capture was actually empty. thanks Matthieu Tourne for reporting this issue. e30ea025c updated docs to reflect recent changes. eb2d84631 fixed test cases in uthread-spawn.t for slow testing modes. 85841a721 refactor: renamed ngx_http_lua_script_copy_capture_code_t to ngx_http_lua_script_capture_code_t. 5d114acb4 optimize: removed the unsed "size" field and related computatins from the script engine. 4beec04ba added (passing) tests for using $0 in the replacement template when no capturing parenthese are used in the regexes. e9dd32848 minor optimizations in the script engine to save a little memory. 57a6471bf updated docs to reflect recent changes; also bumped version to 0.7.15. 96a18a054 fixed more test cases using systemtap that could fail expectedly in slow testing modes. 414c6605a added a (passing) test for github issue #208: coroutine as iterator doesn't work 6f3471615 fixed a test case that may fail expectedly in slow testing mode. 49eab61c2 bugfix: the original Lua VM error messages might get lost in case of Lua code crashes when user coroutines were used. thanks Dirk Feytons for the report in github issue #208. b5492eedb fixed test cases using the deprecated math.mod() method. 6d4150994 added more info about r->main->count to the debugging logs. e82955676 massive coding style fixes. d931db457 bumped version to 0.7.14. 85bab3a9e added a (passing) test to ensure that ngx.req.get_body_data can handle request body bufs more than 2. 7c37f8530 updated valgrind.suppress a bit. c0f62e590 bugfix: for nginx 1.3.9+, rewrite_by_lua* or access_by_lua* handlers might hang if the request body was read there, because the nginx core now overrites r->write_event_handler to ngx_http_request_empty_handler in its ngx_http_read_client_request_body API. 58506f762 added a (passing) test for chunked request body + ngx.req.read_body (for nginx 1.3.9+). bbdb69568 bugfix: for nginx 1.3.9+ compatibility, we return an error while using ngx.req.socket() to read the chunked request body (for now), because chunked support in the downstream cosocket API is still a TODO. af944b179 fixed the style in t/044-req-body.t. 5af60191e updated docs to reflect recent changes. e37b58e37 bugfix: for nginx 1.3.9+ compatibility, we now throw an error in ngx.req.init_body(), ngx.req.set_body_data(), and ngx.req.set_body_file() when calling them without calling ngx.req.read_body() or after calling ngx.req.discard_body(). 480ff8858 removed most of the leak false positives from valgrind.suppress because we now pass the option --show-possibly-lost=no to valgrind by default. 742213977 bugfix: recent versions of ngx_lua failed to compile with old PCRE versions like 6.6 due to the "D" and "J" regex options; now these two regex options require at least PCRE 8.12. thanks Wenhua Zhang for reporting this issue. a1fe49f43 optimize: we no longer traverse the captured body chain everytime we append a new link to it. 22cf24c3f minor documentation tweaks. 07d487396 feature: implemented the "J" regex option for the PCRE Javascript compatible mode in the ngx.re API. thanks lhmwzy for requesting this. b8af0b925 fixed the missing bits for commit 0d120033. a6d8faf2b feature: implemented named subpatterns for ngx.re.match, ngx.re.gmatch, ngx.re.sub, and ngx.re.gsub; also added new regex option "D" to allow duplicate named subpatterns. thanks Ray Bejjani for the patch in github pull #182. e46baf0ad bugfix: commit 2875695b was incomplete. c8c568839 docs: documented the ngx.quote_sql_str API. also updated the docs for body_filter_by_lua* regarding the "eof" argument in subrequests. 2875695b7 bugfix: setting the "eof" argument (i.e., ngx.arg[2]) in body_filter_by_lua for a subrequest could truncate the main request's response data stream. 329907fd0 tests: stopped hitting Google's open DNS server's 12345 port. 0d1200331 tests: eliminated hitting Google's web servers (but we still make use of its public DNS servers). 2603780dd added a test case for a segfault in the nginx core when using ngx_poll_module + ngx_resolver together. ab02c1203 bugfix: failed to compile with the SPDY patch 58_1.3.11 because that patch removed the field from the Nginx core. thanks Chris Lea for reporting this in github issue \#203. bc53e62bc fixed those recently-added tests for 100 continue that may fail expectedly. b9ac4139d refactor: when the nginx core fails to send the "100 Continue" response in case of the "Expect: 100-continue" request header (or just running out of memory), ngx.req.read_body() will no longer throw out a "failed to read request body" Lua error but will just terminate the current request and returns the 500 error page immediately, just as what the Nginx core does in this case. 00bd9a4c3 added (passing) tests for using ngx.req.read_body in the "rewrite" and "access" phases when nginx fails to send the "100 Continue" response. 6398a9048 updated tests to reflect recent changes in the DNS settings for my agentzh.org domain. fec300b73 bugfix: we did not get the request reference counter right when lua_need_request_body was turned on and nginx versions older than 1.2.6 or 1.2.9 were used. f71e4700f fixed a failing test case in normal testing mode. 7786f978e bugfix: because of the recent API behaviour changes in nginx 1.2.6+ and 1.3.9+, the "http request count is zero" alert might happen when ngx.req.read_body() was called to read the request body and nginx failed to send out the "100 Continue" (short) response (like client connection early abortion and etc). thanks stonehuzhan for reporting this issue. 1a52a5819 feature: setting ngx.header.HEADER after sending out the response headers now only produced an error message in the nginx error logs and does not throw out a Lua exception. this should be handy for Lua development. thanks Matthieu Tourne for suggesting this. f6e62d563 bugfix: in body_filter_by_lua, the "eof" flag (i.e., ngx.arg[2]) was not set in subrequests. 7837e433e Merge pull request #200 from chipitsine/master 4b1adde52 OpenBSD-5.2 93e0e2929 docs: bumped version to 0.7.13. e059eac04 bugfix: using a key with underscores in ngx.header.KEY resulted in Lua string storage corruption. thanks rkearsley for reporting this as github issue #199. 87d109fce docs: bumped version to 0.7.12. 935474048 bugfix: ngx.decode_args() might modify (read-only) Lua strings in-place, which could lead to bad Lua string values. thanks Xu Jian for the report and Kindy Lin for the patch. d3280ab61 docs: typo in the code sample for tcpsock:receiveuntil. thanks Yecheng Fu for the patch in github pull #196. 58e14a62f bumped version to 0.7.11. d3c0f2546 docs: fixed a typo in the Lua code sample for ngx.re.gmatch (we forgot to add "do" there). thanks Guo Yin for reporting this issue. 3f69addea Merge branch 'master' of github.com:chaoslawful/lua-nginx-module a78ee7561 bugfix: removed the unnecessary dot from the "config" file. thanks Rafael Souza for reporting this regression. b802870d7 docs: declared compatibility with nginx 1.2.6; also bumped version to 0.7.10. 6e162fd01 minor coding style fixes in ngx_http_lua_variable.c. eabefc797 bugfix: accessing ngx.var.VARIABLE allocated tempory memory buffers in the request memory bool, which could lead to unnecessarily large memory footprint. not it allocates such bufferes via Lua GC. 508486684 updated the tests in 005-exit.t for nginx 1.2.6+. d1613a647 feature: automatically detect LuaJIT 2.0 on FreeBSD by default. thanks rkearsley for the patch. cf18fcbbb docs: explained why "local foo = require 'foo'" is required to load a Lua module. thanks rkearsley for asking. 362fcfe46 documented the request body automatic inheritance behavior in ngx.location.capture; also bumped version to 0.7.9. 6eeb8fb81 minor coding style fixes. 59fc4aea8 bugfix: ngx.status assignment would always be overridden by the later ngx.exit() calls for HTTP 1.0 requests if lua_http10_buffering is on (the default setting). thanks chenshu for reporting this in github issue #193. 543169dfb bugfix: typo in the error message when accessing an nginx variable that has not been defined. eb3a36bb4 updated docs to reflect recent changes. 515658747 Merge pull request #186 from mizzy/fix-date-format-in-readme 457cdf79e Fix date format d4eb39b40 bumped version to 0.7.8. d54a03ebd made the tests in uthread-exec.t less possible to fail the systemtap subtest on slow machines. 477f82efc made the tests for ngx.on_abort() less possible to fail due to random timing issues. d270ade76 Merge branch 'master' of github.com:chaoslawful/lua-nginx-module 46e32a291 bugfix: ngx.req.set_body_file() might lead to memory issues because it directly used the storage of lua strings allocated by the lua GC (we should allocate a new memory block on the nginx side and copy the string data over). 94d950eed bumped version to 0.7.7. b39743aa5 bugfix: when a user coroutine or user "light thread" dies with an error, our Lua backtrace dumper written in C may access one of its dead parent threads which could lead to segmentation faults. fd7b70de6 refactor: now we use the TEST_NGINX_SERVER_PORT env consistently in the test suite. fd51c766c fixed a test case that uses the hard-coded port 8888 which may not be available especially in the "check leak" testing mode that often runs into port shortage. c400c3115 minor coding style fixes in ngx_http_lua_regex.c. 614d6a6ef updated the docs for ngx.req.start_time and ngx.now a bit. 4a4bdd950 Merge remote-tracking branch 'origin/master' into req-start-time 5768a6824 feature: added ngx.req.start_time() to return the request starting time in seconds (the milliseconds part is the decimal part just as in ngx.now). thanks Matthieu Tourne for the patch. f85899f50 Merge branch 'master' of github.com:chaoslawful/lua-nginx-module 696951852 fixed an english typo in the error message for init_by_lua*. e83fabb0e attempted to fix a test that may fail unexpectedly in the "hup reload" testing mode. 50e41da5d fixed a test case in 020-subrequest.t for slow testing modes. e3d3ec3f5 added more docs regarding using ngx.exit() to abort pending subrequests in other "light threads" and setting ngx.status after sending out the response headers. 3583cb08d added tests for the "ngx_slab_alloc() failed: no memory" error message. these require the patch https://github.com/agentzh/ngx_openresty/blob/master/patches/nginx-1.2.4-slab_alloc_no_memory_as_info.patch 15fac2963 feature: setting ngx.status after sending out response headers no longer yield a Lua exception but only leave an error message in the error.log file, which is useful for Lua-land debugging. thanks Matthieu Tourne for requesting this. 930b938d4 fixed several test cases which may fail unexpectedly due to timing errors. 2b48ef43c Merge branch 'master' of github.com:chaoslawful/lua-nginx-module 442b45333 bugfix: when the user callback function registered by ngx.on_abort() discarded the client abort event, the request would be aborted by force when the next client abort event happened. 164ef98f4 feature: the user can now call ngx.exit(444) to abort pending subrequests in other light threads from within a light thread. 780b82686 refactor: we did not need to reset the on_abort_co_ctx field in reset_ctx. cc57703fb updated docs to reflect recent changes. 5feda1fee Merge branch 'master' of github.com:chaoslawful/lua-nginx-module e1dd6ff66 added a test case for a regression introduced by the upstream_pipeline patch of openresty. 857ed86f0 increased the timeout threshold for the slow tests in slow testing modes. 4f7eb4f05 made a test case less possible to fail in slow testing modes like "mockeagain w + valgrind memcheck". 3986c4787 Merge pull request #181 from smallfish/patch-1 4bd074408 Update src/ngx_http_lua_log.c ff1949b07 bugfix: the "light thread" object created by ngx.thread.spawn() might be prematurely collected by the Lua GC because we did not correctly register its coroutine object into the Lua regsitry table. this bug may crash the Lua VM and nginx workers under load. thanks Zhu Dejiang for reporting this issue. 7b0d7daca bugfix: the "light thread" object created by ngx.on_abort() might be prematurely collected by the Lua GC because we did not correctly register its coroutine object into the Lua regsitry table. this bug may crash the Lua VM and nginx workers under load. thanks Zhu Dejiang for reporting this issue. 2ecf5afa8 bugfix: ngx.thread.wait() might hang infinitely when more than 4 user "light threads" are created in the same request handler due to the incorrect use of ngx_array_t for ngx_list_t. thanks Junwei Shi for reporting this issue. 5abd74c3d minor test file style fixes. e6b20cb2e feature: added new dtrace static probe http-lua-user-thread-wait. d3214ca9c bugfix: subrequests with error status code did not trigger output header filtering any more. this bad had appeared in the last commit. 6d7e0c0a5 bugfix: ngx.location.capture/ngx.location.capture_multi might hang infintely because the parent request might not be waken up right after the first time the post_subrequest callback was called. now we also always skip the special response handler altogether for our subrequests. 9ad04360c ported all the documentation tweaks from the nginx wiki site. a9d1383bd minor test case style formatting. 0b838944d fixed various issues in the test suite. 15a5793b5 ngx.exit(N) now no longer throws out a Lua exception when N >= 300 and a response header with a different status code has already been sent (but an error message will still be printed into the error.log file). this change makes Lua code debugging based on ngx.say/ngx.print much easier. thanks Matthieu Tourne for the suggestion. 35b86cd53 bugfix: ngx.exit(N) threw out exceptions when N was 408, 499, or 444 and the response header was already sent. thanks Kindy Lin for reporting this issue. ca262cb46 bumped version to 0.7.5. 8d92e6c67 bugfix: ngx.log() would truncate the log messages with a null character (\0) in it. thanks Wang Xi for reporting this issue. 7c0948a08 bugfix: ngx.req.clear_header() would result in memory invalid reads when removing the 21st request headers. thanks Umesh Sirsiwal for reporting this issue in github issue #176. 1a44b73fa updated docs to eliminate use of package.seeall in code samples and also to explicitly discourage the use of it. a55fd2506 documented the special case that client closes the connection before ngx.req.socket() finishes reading the whole body. fc4391e07 documented lua_check_client_abort and ngx.on_abort; also bumped version to 0.7.4. e06f7e3a2 polished the test cases that could expectedly fail. 0990bdef7 ported the tests for ngx.on_abort() to access_by_lua and rewrite_by_lua. 75be85db6 made the tests less possible to fail in slow testing modes. 1d5b18a81 bugfix: calling ngx.on_abort() twice in a single handler will result in memory leaks; now it returns an error upon subsequent calls. b3a778702 bugfix: request might hang when a callback function is registered via ngx.on_abort() and there was no client abort event at all. also ensured that the on_abort callback will not get called when the request is already done. 0b9466ac1 feature: ngx.exit(N) can now abort pending subrequests when N = 408 (request time out) or N = 499 (client closed request) or N = -1 (error). feature: added ngx.on_abort() for registering user Lua function callback which will get called automatically when client abortion happens. 52e971cb0 renamed the config directive "lua_on_client_abort stop|ignore" to "lua_check_client_abort on|off". ec5214cfc added a test case for testing the kqueue-specific bug in the ngx_http_upstream_test_connect function of the nginx core. 5ba9195e5 fixed a test case regarding cosocket set_keepalive on FreeBSD. 8ed15a432 tweaked the test cases for one-way shutdown for the mockegain writing testing mode because nginx does not really support the one-way shutdown on the client side. 8f8cb23f3 bugfix: using "lua_on_client_abort stop" and doing internal redirects might lead to segmentation faults. 9649c8ba6 bugfix: fixed the -Werror=unused-variable gcc warning on systems without kqueue, which was introduced by commit 9205848. 92058483d bugfix: ngx_lua cosocket's connect() method could not detect errors like "connection refused" when kqueue was used. tests: fixed the compatibilty issues in those test cases that were failing on non-Linux systems like FreeBSD. 31089a419 bugfix: we could not compile on FreeBSD due to the recent work on lua_on_client_abort. 1937d5811 updated --- stap_wait to --- wait in the test suite to reflect the new changes in Test::Nginx::Socket. c5dc5dc14 bugfix: reading on ngx.req.socket() now returns the error "client aborted" in case request body truncation even when lua_on_client_abort is "ignore". bugfix: for edge-triggered events, use of ngx.req.socket() might prevent "lua_on_client_abort stop" from detecting the connection shutdown event. 83f8f9554 bugfix: receiving data on ngx.req.socket() did not return any errors when the request body got truncated; now we return the "closed" error (or "client aborted" when lua_on_client_abort is not configured as "ignore"). feature: implemented new config directive lua_on_client_abort which (atm) takes two possible values, "ignore" (the default) and "stop". 642e54112 Merge branch 'master' into client-abort 5cc8de8e7 code refactoring in the module configuration part. 41243bfa8 code refactoring in the module configuration part. 7b1f3323a documented the new shdict:get_keys() API. also bumped version to 0.7.3. f928feae8 feature: added the "get_keys" method for the shared dictionaries for fetching all the (or the specified number of) keys (default to 1024 keys). thanks Brian Akins for the patch in pull \#170. e607b639b bumped version to 0.7.2. b5531ff5b feature: now we can automatically detect the vendor-provided LuaJIT-2.0 package on Gentoo. thanks Il'ya V. Yesin for the patch in github pull #167. it is still recommended, however, to explicitly set the environments LUAJIT_INC and LUAJIT_LIB. db2d5310b docs: massive wording improvements from Dayo. also bumped version to 0.7.1. 3875a3397 bugfix: ngx.re.gsub() might throw out the "attempt to call a string value" exception when the "replace" argument is a Lua function and the subject string is large. thanks Zhu Maohai for reporting this issue. 7ee528b20 docs: documented the new ngx.thread API. also fixed the __newindex metamethod definition for catching writes to undeclared global varaibles in a Lua module. 1690add7f docs: added a warning for ngx.var.VARIABLE that memory is allocated in the per-request memory pool. also made it clear why "return" is recommended to be used with ngx.exit(). thanks Antoine. 4d8cbe95c fixed those test cases using the UDP cosockets to be prepared for data read in a single run (without EAGAIN, that is). 5d0fb9fea bugfix: the lua light threads would leak in case of nginx filter finalization. this issue was caught by the "check leak" testing mode provided by Test::Nginx while running on Amazon EC2. 2694d7758 bugfix: older gcc versions might issue warnings like "variable 'nrets' might be clobbered by 'longjmp' or 'vfork'", like gcc 3.4.3 for Solaris 11. thanks Wenhua Zhang for reporting this issue. bfcb77b12 resolved conflicts while merging "master" into "thread". 73d8dd231 bumped version to 0.6.10. d3f55d7a7 bugfix: ffi.copy() was used incorrectly in the test cases in 099-c-api.t: it might write out of the buffer. this issue was caught by valgrind on linux i386. 95b276174 fixed a test case using shdict for the "use hup" testing mode. cc5d928cb renamed ngx_http_lua_shared_dict_lookup to ngx_http_lua_shared_dict_get; fixed various issues in this public C function. also added tests for it. ea456890a feature: added public C API ngx_http_shared_dict_get and ngx_http_lua_find_zone as per Piotr Sikora's request. 7fc1dc720 fixed a compilation warning in the cosocket code from some old gcc. thanks Dirk Feytons for reporting this issue as as #162. 0f66b1b33 bumped version to 0.6.9. a30c2d831 made a test case less possible to fail unexpectedly in slow testing mode. beb2bfff4 updated docs to reflect recent changes in ngx.req.get_headers(). a90cc0d99 feature: now ngx.req.get_headers() will return a table with keys in all lowercase by default. made the second argument be "raw". when the "raw" argument is true, the header names will be the original form. b09f15784 feature: when the lowercase argument to ngx.req.get_headers() is true, then any keys like "My-Header-Name" and "my_header_name" will be able to index the "my-header-name" entry in the Lua table returned. (behind the scene, we ngx.req.get_headers() just adds a __index metamethod to the resulting table when the lowercase argument is true.) thanks Matthieu Tourne for the proposal. 0263ef747 feature: ngx.req.get_headers() now takes a second (optional) boolean argument that can be used to convert all header names into the lowercase form. thanks James Hurst and Matthieu Tourne for proposing this feature. 661c261bc refactor: disabled ngx_http_lua_probe_info by default. fe4130e0f feature: ngx.thread.spawn(f, ...) can now take multiple arguments for the "light thread" coroutine's first resume. 56b9b8a46 polished the test for ngx.thread.wait a bit. 0ef27947a bugfix: ngx.thread.wait() did not croak when the argument coroutine is not a user thread at all. also added more tests for bad arguments to ngx.thread.wait(). 009911b4e enabled all the test cases in 098-uthread-wait.t. d680b6b2e added (passing) tests for ngx.thread.wait(a, b) and the slower thread is aborted. 4d0e77f5d feature: ngx.thread.wait() can now take multiple user threads as its arguments and wait on all of them at the same time. it will return the first terminated user thread's result as soon as possible (that is, without waiting for other pending user threads to finish). b842f16a1 refactor: removed the ctx->fatal field and just used ctx->no_abort instead. 5d5edcf02 feature: implemented ngx.thread.wait() for synchronously waiting on a child user thread, which also returns the final results of the last implicit call of coroutine.resume() on the user thread coroutine. so now an non-captured Lua exception in a user thread will not abort other running threads in the same nginx request. a40832732 Merge remote-tracking branch 'origin/master' into thread 97f4474a9 bumped version to 0.6.8. 171de5a7c refactor: renamed ngx_http_lua_uthread_create to ngx_http_lua_uthread_spawn for consistency with the Lua API name. b051763cc refactor: renamed t/*uthread.t to t/*uthread-spawn.t. bcfa39984 Merge branch 'master' into thread 1ff7288eb added a (passing) test for empty pattern in ng.re.match. d37c193a9 bugfix: ngx.re.gsub might enter infinet loops because it could not handle patterns matching emptry strings properly. bugfix: ngx.re.gsub incorrectly skipped matching altogether when the subject string was empty. 4b9100c1d bugfix: pattern matching an empty substring in ngx.re.gmatch did not match at the end of the subject string. ad5e7f7c3 bugfix: ngx.re.gmatch might loop infinitely when the pattern matches an empty string. thanks Lance Li and xingxing for tracking this issue down. 0b6685c20 bumped version to 0.6.7. 8589412e8 Merge branch 'master' into thread 15d8550b6 minor coding style fixes in the lua/luajit bytecode loader. e6297a5db Merge pull request #152 from jinglong/bytecode 00e99d519 bugfix: the ngx.thread API did not work in access_by_lua*. f4e8894e2 api: renamed ngx.thread.create() to ngx.thread.spawn(). 7ba928b52 bugfix: the ngx.thread API did not work in rewrite_by_lua*. 3a30a00ff added some (passing) tests for ngx.redirect + ngx.thread. 3b48d03d1 bugfix: aborting ngx.thread coroutines with pending subrequests caused problems and now we just prohibit this by raising Lua exceptions and aborting the main request. 8f2f149c2 updated t::StapThread to reflect recent changes. c25f2df8a bugfix: ngx.thread abortion did not abort ngx.flush(true) in time. de36decd7 Merge remote-tracking branch 'origin/master' into thread 2bea02618 bugfix: the write event timer might not be removed in time in ngx.flush(true) when ngx_handle_write_event failed. f30e42d94 Merge remote-tracking branch 'origin/master' into thread d3e2e646b bugfix: ngx.flush(true) might not return immediately when it should. 33756e1cd bugfix: ngx.thread abortion did not abort tcpsock:send() in time. 7c65ad1b9 bugfix: ngx.thread abortion did not abort ngx.req.read_body() in time. 73cd491de Merge remote-tracking branch 'origin/master' into thread 51b5421fe refactor: changed the way ngx.req.read_body() handles r->main->count, which opens the door for abortion in the middile. 94e623f6f added a (passing) test for aborting the receive() invocation on the ngx.req.socket() object. 1d74cad19 Merge remote-tracking branch 'origin/master' into thread 9e127b09a bugfix: always remove the read event timer during downstream cosocket finalization if it is not removed yet. 198e48d16 bugfix: NULL pointer access might happen on u->co_ctx in *handle_success and *handle_error functions. this bug had appeared in the previous commits. 1d05ac614 bugfix: ngx.thread abortion did not abort udpsock:receive() in time. c60ea6817 bugfix: ngx.thread abortion did not abort the reading iterators returned by tcpsock:receiveuntil() in time. 0e54fcd7a bugfix: ngx.thread abortion did not abort tcpsock:receive() in time. be896210d bugfix: ngx.thread abortion did not abort tcpsock:connect() in time. 05d4a3b7e refactor: now we use ngx_http_lua_request_cleanup for complete cleanups in all the places. c22c625ec bugfix: ngx.thread abortion did not abort the nginx resolver for ngx.socket.udp in time. ee02a8ca0 updated .gitignore a bit. cd5522dce Merge remote-tracking branch 'origin/master' into thread 9fdf63663 bugfix: the nginx resolver might not be destroyed in time when it was used by ngx.socket.tcp and ngx.socket.udp. 5c22e1d4b bugfix: ngx.thread abortion did not abort the nginx resolver for ngx.socket.tcp in time. 3a916d1e9 Merge remote-tracking branch 'origin/master' into thread b771a2e40 bugfix: when a coroutine aborts with errors, its status might not be updated to "dead". 535edec69 renamed t/094-uthread-exit to t/094-uthread-exit.t. 9e28c48a3 resolved conflicts when merging "master" into "thread". 3b5dc53b8 refactor: removed unnecessary code from the sleep handler for ngx.sleep(). 5e6a5b3e7 bugfix: ngx.thread abortion did not clean up the ngx.sleep timer in time. also refactored the uthread tests a bit. b63c3156a refactor: now we introduce an explicit is_uthread flag for each user thread. b6cb3a136 resolved conflicts while merging "master" into "thread". 07b9b3b6c bugfix: when the entry coroutine was yielded by coroutine.yield() then after it was resumed automatically its status would still be "suspended". 889a24afd refactor: ensure that we always bypass ngx_http_postpone_filter_module when we generating downstream outputs. also removed all the legacy code handling postponed outputs. c1f40cd90 added (passing) tests for ngx.req.socket() + ngx.thread and ngx.req.read_body() + ngx.thread. b4e6bf174 added (passing) tests for UPD/TCP cosockets + ngx.thread. 985c4a5e9 added (passing) tests for ngx.flush(true) + ngx.thread. 518c94eaa feature: added support for manual time-slicing between lightweight threads via the coroutine.yield() API. 3b0d04b95 added a (passing) test for creating user threads in a user coroutine. also tracked user coroutine creation in the test cases for user threads. 428217646 added (passing) tests for the "coroutine status" of user threads. c0ac11978 added (passing) tests for nested user threads. 10c7a0739 Merge remote-tracking branch 'origin/master' into thread 377bcd378 updated docs to reflect recent changes. f02a7323d added several (passing) tests for ngx.thread + ngx.location.capture. 12903c20d test: enabled repeat_each(2) in 093-uthread.t. 6d854044c feature: first prototype for the ngx.thread API (aka the lightweight thread API for ngx_lua) that passes the first bunch of tests. 903a3e55c refactor: even more coding style fixes. 681f0dd61 refactor: massive coding style fixes. 639cc398f refactor: removed the unused function ngx_http_lua_has_inline_var. 946e90741 bugfix: the "resume_handler" field of the subrequest ctx was not properly initialized. 3a7075dcd added comments to the ngx_http_lua_run_thread function; also fixed a coding style issue. 51a68ac94 bugfix: better error handling in ngx_http_lua_wev_handler. cf474bcb9 refactor: improved status code handling in content/access/rewrite_by_lua*. 213acb96f refactor: removed the ctx->entry_co field and also made the coctx->co_status and coctx->flushing fields smaller. 1fc023b26 removed the declaration of the non-existent function ngx_http_lua_resume; also fixed a warning from clang. 7d5d92340 docs: fixed the documenation for ngx.req.set_header and made it explicit that the modified request headers will be inherited by the subrequests. thanks James Hurst for reporting this nit. d0d9140e1 optimize: tcpsock:send() now calls c->send() instead of ngx_output_chain(), which gives about 4src/tcp.c ~ 5src/tcp.c performance boost for a simple test case accessing redis for several times. 67f8bbbde removed the valgrind suppression rules for sendmsg/ngx_channel_write since we already fix these issues via the channel-uninit-params patch: https://github.com/agentzh/ngx_openresty/blob/master/patches/nginx-1.2.3-channel-uninit-params.patch 2e50b1943 updated valgrind.suppress for valgrind 3.8.0. 66e2d98b0 docs: bumped version number to 0.6.5 and also documented the trick for doing background async jobs by using ngx.eof() + keepalive_timeout 0. 0c14852af suppressed the warnings reported by valgrind 3.8.0. 5b5a02dbe fixed a test case in 068-socket-keepalive.t by properly flushing the redis store first. 62a0b6960 updated docs to reflect recent changes. b1289817d added (passing) tests for using parallel subrequests after ngx.eof(). e0adfe5ec bugfix: the UDP and TCP cosockets could not keep track of the current Lua coroutine. now we also explicitly clear the current Lua coroutine context in the main request context to ensure that the I/O scheduler can indeed keep track of the current Lua coroutine itself. e49622d8b added a (passing) test case for using ngx.flush(true) in a user coroutine. fe8d7be13 optimize: we now skip processing in the default write event handler when the write event is not ready. 79dee2697 coding style fixes and also fixed a warning in clang. 2fbb4ada9 refactor: removed the "cur_co" field from ngx_http_lua_ctx_t because it is not necessary at all. 644b0b15c cleaned up the code a bit in ngx_http_lua_wev_handler. 240caaa72 refactor: made ngx.flush(true) keep track of the current Lua coroutine automatically. 59c5231b8 refactor: renamed the confusing "waiting" field of ngx_http_lua_co_ctx_t to "pending_subreqs". 9155f9400 refactor: made ngx.req.read_body() keep track of the current Lua coroutine automatically. 6fba5e1bf refactor: made ngx.req.socket() use the existing req_body_reader_co_ctx field in the context struct. 12981c904 refactor: made the ngx.req.socket() objects keep track of the current Lua coroutine themselves. also disabled the ngx.req.socket() API in subrequests to prevent potential problems. 357d4d761 refactor: made the UDP/datagram cosockets schedule their I/O automatically on the Lua coroutine level. b88aa3eaf refactor: removed the unused "socket_busy" flag from ngx_http_lua_co_ctx_t. 9cb0d829d refactor: made TCP/stream cosockets schedule their I/O automatically on the Lua coroutine level. e2f8b2a6b enabled the http-lua-info static probes in ngx_http_lua_wev_handler. 2f884b83e refactor: made ngx.location.capture() and ngx.location.capture_multi schedule themselves at the coroutine level (instead of the request level). 27dd2bab8 minor cleanup in ngx.sleep(). 7134d428a refactor: made ngx.sleep() schedule itself at the coroutine level. 4abd896cd fixed a test case in 020-subrequest.t for slow machines. 85c658475 made the new subrequest test cases less possible to fail unexpectedly on slow machines. 9fe21af57 use google.com instead of taobao.com in the test suite. a7d6962c2 upgraded version to 0.6.4. e572d8772 fixed the test cases for the mockeagain (W) testing mode. 73faa581d added more tests for bad upstream in subrequests. b3255acda bugfix: reset the subrequest status code when the non-buffered ngx_http_upstream request in the subrequest fails due to timeout errors or premature connection close and etc. this requires the patch for the nginx core to fix an issue in ngx_http_upstream: https://raw.github.com/agentzh/ngx_openresty/master/patches/nginx-1.2.3-nonbuffered-upstream-truncation.patch d06e26018 made a test case requires DNS resolving less possible to fail in slow testing modes. c56a98cd8 bugfix: we should not always return NGX_OK in our post_subrequest handler even if rc >= 300 because it will prevent response headers from being sent. 865cb1981 added a (passing) test for returning NGX_ERROR in the output body filter for the subrequest issued by ngx.location.capture(). 46a3c3d52 updated .gitignore a bit. 9728454af bugfix: the main request might be prematurely terminated if a subrequest issued by ngx.location.capture (or its friends) was finalized with error codes. 75c8c3098 updated valgrind.suppress for i386. 3a90b5740 bugfix: we did not compile with nginx cores without the allow_request_body_updating patch. thanks Dirk Feytons. 3b6f584be tweaked a test case to make it less possible to fail in slow testing modes. fd0a8fb18 refactor: now ngx_lua issues subrequests without updating r->postponed at all so as to allow the parent requests flush outputs immediately without waiting for its running subrequests. this will pave a way for subrequest integration with the upcoming lightweight thread model. 7819b4284 fixed typos in the test titles. ce1bcd53c bugfix: when a user coroutine died with an error, its parent coroutine's status was still 'normal'. thanks jinglong for reporting this issue. 62d67ad2f optimize: removed a duplidate ngx_memzero invocation in ngx_http_lua_reset_ctx. thanks jinglong. 35c1fcd04 docs: removed the note for the issues regarding "normal" state user coroutines in coroutine.resume() and coroutine.status() because we have already fixed them. 50f20351b merged "master" into "thread". 5cb6e9fa5 refactor: now every lua coroutine takes its own context state for its nginx-side activities. bugfix: coroutine.status() returned "suspended" for "normal" coroutines. bugfix: coroutine.resume() did not return an error immediately when operating on "normal" coroutines. feature: added new dtrace static probes http-lua-user-coroutine-yield and http-lua-entry-coroutine-yield. a819a192e docs: documented the new shdict:flush_expired() method. bumped the version to 0.6.3. also mentioned lua-resty-dns in the SEE ALSO section. f09867d91 feature: implemented shdict:flush_expired(max_count) for flushing out expired items up to max_count (or unlimited when max_count == 0). thanks Brian Akins for the patch. b771643db bumped version number to 0.6.2. e650dd118 bugfix: the dtrace static probes did not compile on non-Linux systems like FreeBSD. e64d60bd2 increated the timeout threshold for a test case requires resolving three domain names. 52018289b bugfix: tcpsock:send() might send garbage if it was not the first call: we did not properly initialize the chain writer ctx for every send() call. thanks Zhu Dejiang for reporting this issue. 28317770f feature: added new dtrace static probes http-lua-socket-tcp-send-start, http-lua-socket-tcp-receive-done, and http-lua-socket-tcp-keepalive-buf-unread. ccc4af2a1 bugfix: ngx_http_lua_probe.h was not listed in the NGX_ADDON_DEPS list in the "config" file. e46e4907a bugfix: the send timeout timer for downstream output was not deleted in time in our write event handler, which might result in request abortion for long running requests. thanks Demiao Lin (ldmiao) for reporting this issue. e282c1c6c bumped version to 0.6.1. 936653cbd removed the req_header_cached field from ngx_http_lua_ctx_t because it is not used at all. 43de06a0c merged merge conflicts. c2f3cffd5 bugfix: removed unnecessary code that was for the old coroutine abortion mechanism based on Lua exceptions. we no longer need that at all because we have switched to using coroutine yield to abort the current coroutine for ngx.exec, ngx.exit, ngx.redirect, and ngx.req.set_uri(uri, true). 912707780 bumped version to 0.6.0. ce791df20 documented the limitation in the current coroutine.resume() implementation. 2b560d359 documented the limitation in the current coroutine.status implementation and also included other documentation updates. 7feb3f4f0 fixed a source line exceeding 80 cols. 5c1603354 style: renamed ctx->cc to ctx->cur_co, ctx->cc_ref to ctx->entry_ref, and ctx->cc_op to ctx->co_op. c52320f5f Merge branch 'master' of github.com:chaoslawful/lua-nginx-module 4e5cb2449 bugfix: there was no proper error messages when we tried to resume running coroutines. bugfix: there was error logs for resuming dead user coroutines, which was too chatty. bed05ac93 fixed the developer build script for FreeBSD. c4d796260 avoided using qq.com, taobao.com, and baidu.com in the test cases because the "check leak" testing mode will flush these 3rd-party sites which is very very bad. d6c32ea39 feature: yielding entry coroutines from within the user Lua code will make them resume immediately. 506519492 added a comment. 347214c05 documented the new user coroutine API and claimed that we work with nginx 1.3.4. also updated the TODO list to reflect recent changes. 9228475a5 removed the unused ngx_http_lua_dump_postponed function that was used for subrequest debugging. thanks Dirk Feytons. 47f0bf193 properly handled the errors when the user coroutine does not have a parent. 1c2cae9c7 Merge branch 'master' into coroutine 7b363ee7b bumped version to 0.5.14. 1462d9650 resolved conflicts while merging "master" into "coroutine". afb26d284 more fixes in the dtrace provider file. f7858fffb fixed the argument type again in the dtrace provider. f9dc0dc01 fix strict-aliasing warnings in ngx_http_lua_clfactory_bytecode_prepare c9d779e47 avoided declaring new C types in our dtrace provider. 8e5ebad47 bugfix: redeclared the ngx_http_request_t type in our dtrace provider file. 2c6a88c42 Merge branch 'master' into coroutine a70c1e4c7 bumped version to 0.5.13. 592d24f5a Merge branch 'master' into coroutine 1acd7e93c fixed a source line exceeding 80 cols. a39408060 bugfix: reads of unitialized memory might happen when variadic macros is defined and logging socket errors is enabled: when NGX_HAVE_VARIADIC_MACROS is defined, ngx_log_error_core does not take a va_list typed argument which disallows C function wrappers. bcaf634a2 bugfix: segmentation faults might happen when 1. the nginx worker was shutting down (i.e., the Lua VM is closing), 2. ngx.re.gmatch was used, and 3. regex cache is enabled via the "o" flag. this bug had appeared in ngx_lua 0.5.0rc30 (and ngx_openresty 1.0.15.9). d010f0143 bugfix: pcre_pool_resumed should be initialized to 1. 9043e7af9 bugfix: the pcre pool might not be properly resumed when lua panic happens in the lua coroutine scheduler. 8e3ee4b1e renamed 090-coroutine.t to 091-coroutine.t. f77dffbf3 Merge branch 'master' into coroutine de65585f3 optimize: make the coroutine scheduler faster for the entry coroutines (in contrast with user coroutines). 93d12de22 checked in files that are missing in the previous commit for lua_socket_log_errors. 1efea1b3d docs: documented the new lua_socket_log_errors directive and also updated the TODO list. f6bd4f7e6 feature: added new directive lua_socket_log_errors that can be used to disable automatic error logging for both the TCP and UDP cosockets. thanks Brian Akins for the patch. 45461af3a fixed a source line exceeding 80 columns. f9e7f3703 now we explicitly disable the user coroutine API in running contexts other than content_by_lua*, rewrite_by_lua*, and access_by_lua*. 2f5f9550c updated the systemtap-based test cases for user coroutines. 9c54ac2d2 improved the comments for the first few fields of ngx_http_lua_ctx_t. 626cb4a95 eliminated short enum names NONE, YIELD, and RESUME to prevent naming collisions. also use only 2 bits for the cc_op filed in the ctx struct. 75d2d7ab1 added new static dtrace probe http-lua-user-coroutine-resume. 4679f459a added (passing) tests for calling ngx.exit() and ngx.exec() in deeply nested user coroutines. also added new static probe http-lua-user-coroutine-create. 849492e5b added a (passing) test for deeply nested coroutines. also avoided using 3rd-party web sites in the test cases to prevent flushing them in the "check leak" testing mode. c314499de fixed a source line exceeding 80 cols. da5e42542 Merge branch 'master' into coroutine 44e38b134 fixed a place where we did not check the pointer returned from ngx_array_push. 646b0129d added a subtest for the error logs when resuming dead coroutines. bd78705a1 bugfix: ngx_http_lua_resume didn't recognize dead coroutine if the coroutine was resumed with args 6add2a593 avoided using hard-coded port number of the redis service in the test cases. d476dec56 added a test for using the coroutine-based pubsub API provided by Daniele Alessandri's lua-redis library. dc33fb339 optimize: now we use lightuserdata as the key to the coroutine parents table in the lua registry. we also use lua_rawset and lua_rawget wherever possible. 3572114b5 do not call the public C API in ngx_http_lua_coroutine.c for the sake of consistency. also checks if the request pointer is null in the Lua coroutine API implementations. 4f5e8e2f8 better error handling in inlined Lua loading and running. 9c4c72c5c bugfix: we should avoid complicated stack operations that might require memory allocaitons in the lua atpanic handler because it would produce another exception in the handler leading to infinite loops. a2543aa22 removed C macros that are no longer used. this was a merge mistake happened on the git "coroutine" branch. 9494c1220 bugfix: we should avoid complicated stack operations that might require memory allocaitons in the lua atpanic handler because it would produce another exception in the handler leading to infinite loops. fc2194ac7 more coding style fixes. e69527564 eliminated hard-coded nameserver IP address in the test cases in coroutine.t. 22a252dee bugfix: the main vm stack leaked memory when the entry coroutine completed successfully or tried to yield. abd231c01 even more coding style fixes. 9e90fbefe more coding style fixes. e7ca4988d more coding style fixes. df844cb8e fixed the test plan in coroutine.t and made it work with "check leak" testing mode; also added error message tests to all the test cases there. 676c3dbf8 various coding style fixes. 50357f146 Merge branch 'master' into coroutine 4cb88e205 display the stack top as debugging logs in ngx_http_lua_run_thread. 8d63530b7 fixed the serial number in t/089-coroutine.t. 6f402674b merged branch "master" into "coroutine". 3388d424f updated docs to reflect recent changes, especially the new "openresty-en" mailing list for English speakers. 0ee0c49cf bugfix: the UDP cosocket object could no longer be used after an read or write error happened. d577a3818 bugfix: ngx.exit(status) always resulted in 200 OK response status when status > 200 and status < 300. thanks Nginx User for reporting this issue. 63daa7571 minor coding style fixes. f0efac25b updated the error message in docs to reflect recent changes. dfe620204 bumped version to 0.5.11. 1dc7634b5 improved error message when calling ngx.req.socket() when the request body aleady exists. ef4a8acd7 documented that ngx.req.socket() is required to be called before ngx.req.init_body(). a071d3ee6 fixed two test cases for ngx.req.socket + ngx.req.append_body. also added a test for calling ngx.req.socket *after* ngx.req.init_body. 04ef7a499 bugfix: ngx.req.init_body/ngx.req.append_body/ngx.req.finish_body could not work with ngx.req.socket and resulted in infinite loops when the nginx request header reader has pre-read the beginning part of the request body. thanks Matthieu Tourne for reporting this issue. bugfix: the ngx.req.socket() object could not handle pipelined requests in some special cases. feature: added new dtrace static probe nginx_lua:::http-lua-req-socket-consume-preread. db0bebedb documented the ngx.req.init_body, ngx.req.append_body, and ngx.req.finish_body APIs; also bumped the version number to 0.5.10. 4697b1dc2 skipped the hup tests in "check leak" testing mode. d29e8b330 various fixes in the test suite for the "use hup" testing mode. 3ef8844b1 minor test updates d07f97163 fixed the test plan in 089-phase.t so that it works with different repeat_each settings. b994240df added stap based tests for client body temp file cleanups. 446e3477d fixed two places of variable set but never read reported by the clang static analyzer. 88ad0a001 fixed various corner cases for ngx.req.init_body/append_body/finish_body. also added some test cases for these new API. 20620cb32 fixed a clang warning regarding strncmp. d32294612 Merge branch 'master' into req-body 3fc42b417 fixed the ngx. table initial size. 15aef44c8 resolved conflicts while merging branch "master" into "req-body". 9b3bbf4f8 documented the ngx.get_phase() API. 28a022db2 updated .gitignore to reflect recent changes. 02a8b7ba9 minor fixes in the ngx.get_phase() call. c1cd17315 feature: added new Lua API, ngx.get_phase(), for fetching the name of the current running phase from within Lua. possible return values are "set", "rewrite", "access", "content", "log", "header_filter", "body_filter", and "init". thanks James Hurst for the patch. bd66f77fe bumped version number to 0.5.9 d1cfc94c8 bugfix: buffer error would happen when the "args" option table to ngx.location.capture (and ngx.exec) contained a multi-value argument whose key also required uri escaping. thanks Matthieu Tourne for reporting this. 0f62a62e3 bugfix: 3rd-party nginx C modules that use the public C API function, ngx_http_lua_add_package_preload, could result in segfault at nginx server startup due to uninitialized Lua VM pointer. thanks Ray Bejjani for reporting it. ebeb4ea8e fixed the provider name in stability attributes in ngx_lua_provider.d. d3a9ba25b feature: initial support for dtrace static probes. it requires nginx-dtrace though: https://github.com/agentzh/nginx-dtrace c25689b93 updated docs and bumped version to 0.5.8. a624ee948 updated .gitignore a bit. 3eab7b036 ensured that proper error message is always thrown when the iterator returned by ngx.re.gmatch is used in the context of another nginx request. e73e24443 bugfix: ngx.re.gmatch() might result in segfaults during nginx request cleanups if the iterator returned by ngx.re.gmatch() was collected (by Lua GC) before request cleanups. this bug had appeared in ngx_lua 0.5.0rc30 (and ngx_openresty 1.0.15.9). thanks Wayne for reporting this issue. 54c0a3549 bumped version to 0.5.7. d17a942ca Merge pull request #141 from dirkfeytons/no_pcre_compile_fix 8df3747ec Fix issue with unused variable when compiling without PCRE support. 6d67fc4b1 tweaked a test case to make it less possible to fail in slow testing mode. 1cae67d5e fixed a test case. 24fc460b4 documented the new options table argument and the "pool" option for the tcpsock:connect() method. 992e4f026 bugfix: tcpsock:connect(): numeric pool option values did not really work. also nil pool option was caused trouble too and we disallow that now. 31aa26383 rename coroutine testsuite name 8c03cc5a4 Merge branch 'coroutine' of https://github.com/chaoslawful/lua-nginx-module into coroutine 927ef1e86 Merge branch 'master' into coroutine 6a375a651 Merge pull request #138 from jinglong/coroutine 4f208bff2 delete useless comment in ngx_http_lua_thread_traceback 0976365ca update ngx_http_lua_thread_traceback to print the full traceback for the current coroutine and his ancestors 1d8d1578f feature: added an optional "optional table" to tcpsock:connect() which accepts a "pool" option to allow the user specify a custom pool name intead of the automatically generated one based on the host-port pair or the socket file path. thanks Brian Akins for the patches. 06abbea6b documented the UDP/datagram cosocket API. 0a2d1d246 bugfix: udpsock:send() might crash on null pointer access when the request object is absent or the u pointer is null. 4ae7d6a3c added (passing) tests for the size argument of the udpsock:receive(size) method. 49c29a081 feature: added the udpsock:close() method. 1a8bd0f14 merge with master 268493900 Merge remote-tracking branch 'origin/master' into udp-socket 405efbabd tweaked the test case a bit. 05c3a1e75 bugfix: the udp cosocket API could not talk over a unix domain socket. 24991b68a added a (passing) test for receive() timeout. 8b1040d25 bumped version number to 0.5.6. 053999e59 added a test case for successive udpsocket:setpeername() calls. 010d17d48 removed a useless comment from ngx_http_lua_socket_udp.c. 06d654b02 documented the ngx.req.get_method() and ngx.req.set_method(method_id) methods. 80e86f554 updated docs to reflect recent changes. 3b51a96c2 merged branch "master" into "udp-socket". 0cf6c86fa bugfix: the tcp/stream cosocket object might hang when another concurrent request is accessing it while its operation is still in progress; now we always check for potential access conflicts and return the "socket busy" error string if it is indeed the case. fd412f72e bugfix: the udp cosocket object might hang when another concurrent request is accessing it while its operation is still in progress; now we always check for potential access conflicts and return the "socket busy" error string if it is indeed the case. b6b23570a fixed the test suite to reflect recent changes. 0280aaa4f Merge remote-tracking branch 'origin/master' into udp-socket 3824e4466 udpsock:connect(): now we fetch ngx_socket_errno in case of error as soon as possible. 567da366d bugfix: the tcpsock:connect() method always returned the (vague) error strng "connect peer error" instead of the (detailed) system error string. 3232eb078 added more tests for udp cosockets. 8157284b8 bugfix: the udpsock:connect() method always returned the (vague) error strng "connect peer error" instead of the (detailed) system error string. 4a79d1b8d optimize: udp cosocket: now we use a global (static) receive buffer to avoid dynamic allocations on heap. f85139757 Merge remote-tracking branch 'origin/master' into udp-socket 42d9617e8 merged branch "master" to "udp-socket". 787a7b122 fixed a minor coding style issue. e9a74f68b feature: implemented the UDP cosocket API, ngx.socket.udp(). 30601c71f 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. 007d61a7c bugfix: tcpsock:receive() and tcpsock:send() always returned "error" as the error message. now it properly returns the system error string. 61858d95d 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. e9d5d601a feature: added new Nginx API for Lua: ngx.req.set_method(method_id) and ngx.req.get_method. thanks Matthieu Tourne for suggesting these. 4960e01ec bugfix: we should always test if the request object pointer is null in the ngx.req.*_body API. c2f74d15e checked in a (skipped) test case for subrequest request headers handling. 05c0f5a8c bugfix: ngx.exec() did not accept the nil value for its second (optional) argument. 166de0c46 updated the TODO list in docs to reflect recent changes. 584ec028b 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. 4275482f4 documented the init_by_lua* directives and also bumped version number to 0.5.5. 6e5e1738f Merge branch 'master' of github.com:chaoslawful/lua-nginx-module into coroutine 588ee4dcb removed a test in t/023-rewrite/exit.t. 5126e8153 fixed a test case in 085-if.t that hard-coded TEST_NGINX_CLIENT_PORT in nginx config. ce4314d46 bugfix: init_by_lua* might be skipped altogether when HUP config reload was used. 5445e0e8c bugfix: invalid memory reads might happen on HUP config reload when lua_shared_dict is used. 608c89bbf fix typo in config 8f1a44363 fix compiling errors 9c3c01aa4 remove unexpected merged codes 35bf172eb merge jinglong's commit bb7d35eaa merge master and jinglong's commit 2d3c907f4 Merge pull request #135 from jinglong/coroutine 27366974e improve coroutine apis c984bedd2 fix a harmless typo in ngx_http_lua_run_thread 943b3fe7a Merge branch 'init' ae9b7893c enlarged the timeout setting for TEST 16 in 082-body-filter.t to make it less possible to fail in slow testing modes. 8149324c2 feature: enabled print() and ngx.log() in the context of init_by_lua*. 15ec27758 bugfix: init_by_lua* might result in segmentation faults when multiple lua_shared_dict instances are defined. f4a15e29a feature: added new directives init_by_lua and init_by_lua_file. ab41caaf5 feature: now we print backtrace to error.log when Lua errors happen in body_filter_by_lua*. dae23ad7d fixed the test plan in t/041-header-filter.t. 240fc4ab3 feature: now we print backtrace to error.log when Lua errors happen in header_filter_by_lua*. b75195c40 fixed the test plan in 001-set.t. 97ba958d0 feature: now we print backtrace to error.log when Lua errors happen in set_by_lua*. e876411bd feature: now we print traceback to error.log when Lua errors happens in log_by_lua*. 7ce7fb2e2 coding style fixes in ngx_http_lua_socket_tcp.c. 924d093ea Merge branch 'master' into backtrace c03574631 Merge branch 'udp-socket' f8074dca4 renamed ngx_http_lua_debug_traceback to ngx_http_lua_thread_traceback, and other naming changes. dbc4ca764 renamed ngx_http_lua_debug_traceback to ngx_http_lua_thread_traceback, and other naming changes. 2902f9ff2 Merge branch 'master' into udp-socket 5a539500c bugfix: upstream data buffers were not marked as fully consumed when body_filter_by_lua* is used and ngx.arg[1] is overritten. this could result in connection hang for large response bodies. thanks Tzury Bar Yochay for reporting this issue. 418024960 updated .gitignore. a04e204d0 renamed ngx_http_lua_socket* to ngx_http_lua_socket_tcp* to prepare for the udp cosocket API addition. a96dd5515 bumped version to 0.5.4. d2dc90839 optimize: fixed the initial table size for ngx.req. 9ae5a3435 Merge branch 'master' into req-body 3074fddd1 fixed some english grammatical issues in the comments. e1e5b7f3b use ngx_memzero instead of memset in the previous patch from chaoslawful. 47eff35e9 bugfix: fix issue #132 dereferencing type-punned pointer will break strict-aliasing rules 538b97ae9 updated docs to reflect recent changes. 0178d4e7b bugfix: ngx.say and ngx.print might cause nginx to crash when table-typed arguments were given. thanks sztanpet for reporting this in github issue #54. 0428b88fc Merge branch 'master' of github.com:chaoslawful/lua-nginx-module c2d095a1f added some (passing) tests for "location if" compatibilities. f73785c64 updated docs to reflect recent changes. 09f063024 fixed an issue in the test case in 082-body-filter.t: we should not use "echo" and "content_by_lua" in the same location. 553432b59 bugfix: header_filter_by_lua* did not run at all when body_filter_by_lua* is defined at the same time. thanks Tzury Bar Yochay for reporting this issue. 5d59d498a reindexed the test in t/041-header-filter.t. 9f633c860 added a (passing) test for clearing the Content-Length response header in header_filter_by_lua. 0ff8afe0e fixed test cases that rely on the old (broken) HTTP 1.0 support in ngx_echo. 7d6547aeb docs: added more documentation for the Lua/LuaJIT raw bytecode support. thanks Wayne. 17fbfb771 optimize: merged two successive nginx pool allocations in ngx_http_lua_socket_resolve_handler to reduce overhead. 37a9fcd87 bumped version number to v0.5.1. a35ff3636 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. 3a8d8dadc Merge branch 'master' into req-body 0bb38b0bd made tests less possible to fail in tcp-socket-timeout.t when the DNS nameserver happens to be slow. cd0139dc9 fixed some coding style issues. a8e1f16f0 docs: redocumented the "inclusive" option for the cosocket:receiveuntil method. c4d5e3a24 Merge branch 'master' into inclusive e0a6a36c7 added a (passing) test for default_type + charset + content_by_lua. 2b6c95cfe updated README and README.markdown by the tools. 565452051 bumped version number to v0.5.0rc32. 0eba3537b Merge branch 'master' into inclusive e0cabf043 added more (passing) tests for the "inclusive" option of cosocket:receiveuntil(). 2b8ea405f improved the error handling of the "inclusive" option for cosocket:receiveuntil and also added some test for this. removed the tests for the "inclusive" option to a separate test file, 084-inclusive-receiveuntil.t. 2174ed2e5 fixed a bad test case in 083-bad-sock-self.t. 9905167e3 Merge branch 'master' of github.com:chaoslawful/lua-nginx-module 51bc8fb49 bugfix: the lua VM might crash when calling the cosocket methods with a bad-typed self argument. 5545cfaad Merge branch 'master' into inclusive cdb6a6f94 fixed a coding style issue in the previous commit. 146fe0c61 bugfix: the zero-size buffer alert could occur in body_filter_by_lua* when the current buf is a special "eof" buf and the user has turned off the "eof" flag by assigning false to ngx.arg[2]. cea392987 Merge branch 'master' of github.com:chaoslawful/lua-nginx-module c66daf057 Merge remote-tracking branch 'jinglong/bytecode' into bytecode bad3eee54 Use more descriptive names in ngx_http_lua_clfactory.c(like LUA_LITTLE_ENDIAN_4BYTES_CODE) 33e62fcf3 docs: documented the body_filter_by_lua* directives and the new bytecode file loading support. d92a14d7b Merge branch 'master' into body-filter 5fa0dbc1f merged jinglong's "bytecode" branch into "master". 1c6280f57 docs: documented the lua_transform_underscores_in_response_headers directive. f81ceeb40 feature: added new directive lua_transform_underscores_in_response_headers. thanks Kindy Lin. b09b8ee44 1,fix a bug in loading bytecode(faild to load no-stripped bytecode of luajit) 55153ceaf fixed the test plan in t/082-body-filter.t. f9e534f05 Merge remote-tracking branch 'origin/master' into body-filter 9cabf1c4a minor tweaks of the error messages and coding style issues in the byte-code support patch from jinglong in github pull #124. 3e9984a03 various coding style fixes. 71467020d added (passing) tests for the on-demand handler registration of body_filter_by_lua*. 2a63a168b docs: added a note for installation with lua 5.1 on ubuntu 11.10. thanks Dan Sosedoff. 81964d5a8 bufix: fixed the directive context for set_by_lua and set_by_lua_file. they really work in the contexts "server", "server if", "location", and "location if". thanks Liu Taihua. 119b85e16 feature: the lua statement "return ngx.ERROR" can now be used to abort the output stream in body_filter_by_lua*. 91b23e692 feature: ngx.arg[1] now also accepts a lua table of lua strings as its new value. 9f488b0ec feature: ngx.arg[1] and ngx.arg[2] now support overwriting in body_filter_by_lua*. 5591fb0cb Merge remote-tracking branch 'origin/master' into body-filter 19c803d76 merged "master" into "body-filter". 6183ad4f5 docs: fixed a typo: ngx.now returns time of the resolution of milliseonds, rather than microseconds. thanks Wang Xi. dffaf4896 fixed the test "unexpected globals sharing by using _G (header_filter_by_lua*)" by chaoslawful which did not really test what it was supposed to test. 6ef34e54f bugfix: lua main thread stack might leak when header_filter_by_lua* is used. 1ecb2f40c bugfix: too many values on the lua stack might be concatenated when generating backtraces for lua errors and the lua vm would crash when there happened to be values on the stack that could not be concatenated (like nil). stylefix: renamed the debug_traceback function to ngx_http_lua_debug_traceback. optimize: eliminated unnecessary string concatenations when generating backtraces for lua errors. 46019a271 reindexed the tests in t/075-logby.t. dff9bb898 fixed the test plan for 081-bytecode.t for the "check leak" testing mode. 172fe05aa Merge remote-tracking branch 'upstream/master' into inclusive 2e90054ca Merge remote-tracking branch 'upstream/master' into req-body 5c14bcd25 Adding code similar to nginx core, to prevent allocating buffers much larger than the request itself. 427d3d572 Update code, still using GLOBALS_SYMBOL_REQUEST. See Commit 89a997. 5078b1443 bugfix: the ngx.arg API was not usable within external lua module files in set_by_lua*. diagnosis: now we issue user-friendly error messages when the nginx lua APIs are used in the wrong directive contexts (e.g., using ngx.location.capture in set_by_lua*). 4e4e0b32c fixed more coding style issues in common.h. 64912a7b2 fixed coding style issues in common.h. 725c3a14e renamed ngx_http_lua_create_ng_table to ngx_http_lua_create_new_global_table; also fixed some coding style issues in 001-set.t. b42f6c8c5 Merge branch 'master' of github.com:chaoslawful/lua-nginx-module acb1b47aa minor coding style fixes in ngx_http_lua_logby.c. 6ce7490d6 Merge branch 'master' into body-filter 3520a90a6 merge conflictions e5363496e bugfix: ngx.arg could not be used in user lua modules. 9bcb50325 feature: initial cut on the body_filter_by_lua and body_filter_by_lua_file directives. 6c650fafd bugfix: fixed unexpected globals sharing by using _G in log_by/header_filter_by/set_by fede5ccb5 minor coding style fixes in ngx_http_lua_logby.c. 02824efe0 Merge pull request #124 from jinglong/bytecode c5fde025d Merge branch 'master' of github.com:chaoslawful/lua-nginx-module 40af5cdd8 cleaned up the "config" file, making lines shorter and easier to merge. thanks Matthieu Tourne for the patch. 656f6e272 eliminated including C headers that we do not actually use. 5347f9174 Merge branch 'master' of github.com:chaoslawful/lua-nginx-module 08b0433d0 bugfix: fixed unexpected globals sharing by using _G 8481276e1 optimize: now we register the "ndk" and "ngx" lua tables for log_by_lua* at config time rather than request time. this gives significant performance boost. also improved error handling in log_by_lua*. f3a3757c2 enforced lua garbage collection full cycles in those shdict test cases to prevent memory leak false alarms. 294ba6fe6 1, fix code style b79953e0e fix merge conflict 9ea8ba052 add simple test for coroutine support f4ed28d2d improved lua error handling in header_filter_by_lua*. 0f652c040 optimze: explicitly specified non-zero initial size for certain lua tables. 7ce0102d1 optimize: now we register the "ndk" and "ngx" lua tables for header_filter_by_lua* at config time rather than request time. this gives significant performance boost. b8e5b0219 fixed the "ngx" table initial size for set_by_lua*. f19686330 optimize: now we initialize the "ngx" and "ndk" tables at config time instead of at request time. bugfix: the lua vm crash protection based on longjmp for set_by_lua* was not really working. d6d7f872a renamed function init_ngx_lua_registry to ngx_http_lua_init_registry, and init_ngx_lua_globals to ngx_http_lua_init_globals. df104f916 optimize: now we store the metatables for ngx.req.socket() and ngx.socket.tcp() objects into the lua registry. 89a997aca optimize: changed the string keys to light user data for various tracking tables (coroutines table, regex cache table, cosocket connection pool table, ngx.ctx table, and etc). This gives minor performance improvement from eliminating key hashing and etc. thanks Dirk Feytons. 5cc8fd50f fixed a typo in program comments. thanks Dirk Feytons. f7f744efd Fix typos in error message. 1ce845313 docs: fixed the sample code for log_by_lua. 7292647a7 docs: marked the APIs that are available in the log_by_lua* context. ead78b766 bumped version to 0.5.0rc31. 1bf725345 updated the docs for log_by_lua and log_by_lua_file. 285b72716 bugfix: memory leak would happen when accessing a location using ngx.ctx in Lua contexts other than log_by_lua* but there is also another location that uses log_by_lua*. 445b916a7 bugfix: header_filter_by_lua would leak memory when it is the only directive of ngx_lua configured in a location *AND* ngx.ctx is used. 113c65818 reindexed the test numbers in t/025-codecache.t. c8063a8bb updated .gitignore again. cd825f51c updated .gitignore. 2a3d31d38 Merge branch 'logby' 3b1e9aaff updated docs to reflect recent changes. a58ebf89f 1, add more test cases for loading bytecode 76dcccdfd updated valgrind.suppress for linux i386. cfd3a0e43 now we use environments in the developer build script instead of hard-coded paths. e72096a47 1, check the version when loading bytecode fa64f3628 added downstream cosocket tests for the rewrite phase. 429b603c5 optimize: now we no longer call ngx_http_post_request to wake up the request associated with the current cosocket upstream from within the cosocket upstream event handlers, but rather call r->write_event_handler directly. this change can also make backtraces more meaningful because we perserve the original calling stack. 54d8736f6 added cosocket tests for lua code running at the rewrite phase. 26db2dda1 bugfix: cosocket:connect() might hang on socket creation errors or segfault later due to left-over state flags. 39b9138cf 1, add a test case for loading bytecode 1099cd3b6 minor fixes in cosocket. 2a418d8bb 1, add support for loading bytecode(both lua and luajit) 802e95b30 bugfix: the _G special table did not get cleared when lua_code_cache is turned off. thanks Moven. 95857be6f feature: ngx.log() now checks if the log level number is in the valid range (0 ~ 8). thanks Xiaoyu Chen (smallfish) for suggesting this. 154f5af33 fixed the newly added test case for log_by_lua + shared dict. 7ba84a74a Merge branch 'master' into logby 2afa6bfb3 added one (passing) test for log_by_lua + shared dict. 86f97f00b bugfix: ngx.sub() could leak memory when the "replace" template argument string is not well formed and the "o" regex option is specified. this issue was caught by Test::Nginx::Socket when setting environment TEST_NGINX_CHECK_LEAK=1. fd681f8d0 bugfix: fixed a compilation error in the previous commit. b30b56cf3 bugfix: ngx.re.gmatch leaked memory when the "o" option was not specified. this bug was caught by Test::Nginx::Socket when setting the environment TEST_NGINX_CHECK_LEAK=1. 9c96a3aaf Merge branch 'master' into leak f9e61f044 docs: massive wording improvements from the nginx wiki site. thanks Dayo. f74372491 Merge branch 'master' into leak d2d1904b6 fixed test plan for 056-flush.t for the "check leak" testing mode. 8c0221fc0 fixed test plan for 056-flush.t for the "check leak" testing mode. a058363c1 fixed another issue in the test case for the memory leak issue that was in receiveuntil(). d80359814 fixed an issue in the test case for the memory leak issue that was in receiveuntil(). 225fc72fc fixed invalid HTTP request headers in the req-body test cases. 1aab85928 bugfix: receiveuntil could leak memory, especially for long pattern string arguments. this bug was caught by Test::Nginx::Socket when setting the environment TEST_NGINX_CHECK_LEAK=1. 6440e4e61 updated valgrind.suppress further for linux i386. c7374aaa3 updated valgrind.suppress for the "hup reload" + valgrind/memcheck testing mode. a8dd2d70e added 080-hup-shdict.t to test if the data in shared dict is survived through nginx HUP reload. also updated valgrind.suppress accordingly. 9fbba9aeb added tests for the on-demand handler registration mechansim for log_by_lua*. dbac00503 resolved conflicts while merging "master" into "logby". we now adopt the new on-demand handler registration mechansim for our log_by_lua* directives. a287451c1 Refactored on-demand handler registration acb1cde11 minor coding style fixes in capturefilter.c. e1a91744d reindexed tests in 079-unused-directives.t ce0921789 added tests for handlers registered on-demand (i.e., determined whether their config directives are actually used in nginx.conf). 564d2bb8c minor coding style fixes and debug log message adjustments. 6d2e7a0f6 Merge branch 'master' into logby a830b61eb 078-hup-vars.t: no need to use the debug log level. a486c4cf0 added tests for the nginx core bug regarding nginx variables under HUP reload: http://mailman.nginx.org/pipermail/nginx-devel/2012-May/002223.html ab5069e5d merged branch "master" into "logby". 1075c325e fixed tests to work-around an issue with nginx listening on a unix domain socket (we have to remove the socket file before sending HUP). f1548c48d fixed tests to work-around an issue with nginx listening on a unix domain socket (we have to remove the socket file before sending HUP). c50378562 fixed ngx. table initial size for content/rewrite/access_by_lua*. 6ab79176d Reverting to da5e60c949dcd4d8ed68b838aaf681a933c3bae7 609255f1b Merge branch 'cleanup' d6ef8d61a Cleanup config, make line shorter and easier to merge Adding cleanup branch for potential other style refactoring 104b80949 Merge remote-tracking branch 'upstream/master' da5e60c94 fixed tests for floating point number inaccuracy issues on linux i836. e49edfa9d fixed typos in the tests. 54a0e568c minor optimizations in ngx.sleep handling. a89d8ce47 added more tests for calling ngx.location.capture before and after ngx.sleep. 2362917a6 updated docs to reflect changes (including documenting ngx.sleep.) c5be5ff2f optimize: fixed the ngx. table initial size. d6ba6b450 renamed t/074-sleep.t to t/077-sleep.t because we already have t/074-prefix-var.t (from the "prefix-var" branch). 4e7379f93 reindexed the test numbers via the "reindex" script. cc3de56b1 Merge branch 'master' into sleep 5a55dd6f4 bugfix: fixed various issues in jinglong's patch for adding ngx.sleep() in github pull request #120. 6446ee71b documented the rewrite_by_lua_no_postpone directive. 8f6fab621 Merge branch 'master' into no-postpone e7754953d updated docs to reflect recent changes. 8e750fa1b bugfix: the receiveuntil iterators would have memory issues with very small lua_socket_buffer_size settings in the inclusive mode. 1f8c3818f Adding test for inclusive mode 8f306812a Fix receiveuntil("pattern", { inclusive = false }) 05dee24fa Adding documentation for the receiveuntil option { inclusive = true } d509d07ec Adding logic for the receiveuntil option { inclusive = true } 92b47f9da fixed typos in the test case names in 075-logby.t 6e732efe6 1, fix a bug in sleep() (the number of argument must be 1) b2481bebe 1, update t/062-count.t(total count of ngx.* to 88) 2, update t/074-sleep.t 080990db7 1,add test cases for ngx.sleep() 4c207e540 1, add ngx.sleep() 0782f475c merged from master 2fd7a3a50 initial implementation works 3ac6f2614 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. 205799736 Adding ngx.req.init_body() ngx.req.append_body() ngx.req.finish_body() 46aa87805 fixed coding style in Matthieu Tourne's patch for adding the rewrite_by_lua_no_postpone directive; also added some tests for it. 436cd30a9 Adding directive rewrite_no_postpone b241806f2 Merge branch 'master' into logby f229fccc5 various fixes in ngx.decode_args(). df2ec5acf added tests for the optional max_args argument to ngx.decode_args(); also documented this optional argument. 56d992b1a docs: documented how relative paths are processed when *_by_lua_file directives are used; also documented the $prefix and ${prefix} notations in lua_package_path and lua_package_cpath directive values. 5be3f2b36 Merge branch 'master' into prefix-var 3d6f752a0 docs: updated docs to reflect recent changes in set_by_lua. 89ba48983 Merge branch 'master' into setby 47ec23a33 updated docs to reflect recent changes in the logging API. e9cb51043 fixed a test case in 009-log.t for luajit 2.0. d823b8454 Merge branch 'master' into logging 2bd1f0f80 updated docs to reflect recent changes. 732fe370a added many more tests for log_by_lua* and also fixed issues with ngx.ctx in log_by_lua*. 447c7488b fixed some coding style issues in Matthieu Tourne's patch for log_by_lua* and also added a simple test for log_by_lua. 398710700 Adding log_by_lua and log_by_lua_file and documentation fd193aa4c fixed ngx. table initial size for ngx.decode_args(). 77ca488a5 Adding documentation for ngx.decode_args() 6a61f4384 added some tests for ngx.decode_args(). ecd83e9a1 minor coding style fixes in Matthieu Tourne's patch for adding ngx.decode_args(). 674b8709a Add ngx.decode_args() 4b4f48007 resolved conflicts while merging master into prefix-var. 2178f0bac updated README and README.markdown to reflect recent changes in both the .wiki doc and wiki2markdown.pl. 69a3d8970 Merge pull request #118 from zhuzhaoyuan/master c5016c17f Fixing incorrect merge from prefix-var branch 886792c5f Adding documentation for ngx.decode_args() 50f47a99b Merge branch 'devel' d0f5ed363 Merge remote-tracking branch 'upstream/prefix-var' 849ca03dc Merge remote-tracking branch 'upstream/logging' cb5c37ec7 generated README.markdown by using wiki2markdown.pl b1ca2dd5b updated the wiki file (http://wiki.nginx.org/HttpLuaModule had been updated) a3524ab96 synchronized the wiki from http://wiki.nginx.org/HttpLuaModule 54d4b8fe1 Merge branch 'master' of https://github.com/chaoslawful/lua-nginx-module 087694f4a feature: special nginx variable $prefix is now available in the lua_package_path and lua_package_cpath, which evaluates to the server prefix string (as specified by the -p PREFIX command-line option of the "nginx" executable). thanks Matthieu Tourne for the patch. efb33ad7c added a leading comment to README.markdown to indicate that is is generated automatically. 1e6de3d93 optimize: eliminated unnecessary lua-side operations in ngx.log() and print(). 33b3d45ea modified the message prefix of print() from "[lua] print: " to just "[lua] "; also updated tests to reflect recent changes. 932a748a4 Merge remote-tracking branch 'upstream/logging' 227b9c3ef Merge remote-tracking branch 'upstream/master' 0a258abde fixed some typos 0538286ea Merge pull request #117 from zhuzhaoyuan/master 77c715d45 fixed some minor grammatical errors 5f1c7c32c lua -> Lua fd0fa3e54 Merge branch 'master' of https://github.com/chaoslawful/lua-nginx-module 2ca579687 Merge pull request #116 from dirkfeytons/master 34d6f7da0 bugfix: the set_by_lua directive did support nginx variable interpolation and there was no easy way to use the dollar sign characters in the literal Lua source. the set_by_lua_file directive still supports nginx variable interpoloation in its lua file path argument. thanks Vittly for reporting this in github issue #111 and jinglong for the test in github pull #115. edd3e3f62 Only include lua_regex_cache_max_entries if NGX_PCRE is defined. 2cd7586ce feature: added the "[lua]" prefix to the log messages produced by ngx.log() and print(). thanks Matthieu Tourne for the patch. 28da7e3f9 changed the chunk name of set_by_lua from "set_by_lua_inline" to "set_by_lua". f75f20d18 feature: ngx.log() and print() now output more debugging info, i.e., the current lua source file name (if any), the current source line number, and the current calling lua function name (if any), into the nginx error.log file. thanks Matthieu Tourne for the patch. f8e612af3 changed the chunk name of set_by_lua from "set_by_lua_inline" to "set_by_lua". 57a189a55 Merge pull request #114 from monadbobo/master 8e2e4a9e7 remove some dead assignment via scan-build. e841106d1 added a (passing) test for setting ngx.header.content_encoding that should bypass the ngx_gzip output filter. c465d2bdc Add ngx.decode_args() 57e8d9991 added a (passing) test case for cosocket:send(""), that is, sending an empty string. a3961fe7b bugfix: cosocket:receive(0) was not allowed and would throw an error saying "0" is a bad pattern. thanks huang kun for reporting this issue. ca3239a25 Merge branch 'master' of github.com:chaoslawful/lua-nginx-module cd04674b8 deleted a reduntant blank line c4f371671 fixed minor coding styles 54f5a70d7 deleted a reduntant blank line 4174f0c6b fixed minor coding styles 61960c5ad Merge branch 'master' of github.com:chaoslawful/lua-nginx-module 0d1db00cf remove duplicate string conversion 7a7ac79f3 removed dead code found by Simon Liu. d457e01b2 enlarged the timeout threshold of TEST 10 in 027-multi-capture.t. a7bd2ef07 enlarged the resolver timeout for TEST 4 in 058-tcp-socket.t. a11ba9b04 enlarged the timeout threshold of TEST 5 in 067-req-socket.t. 3584b61d2 Merge remote-tracking branch 'zhuzhaoyuan/master' fbbc89d93 cosocket: simplified the code for downstream cosockets a bit. 8e24cd1ef Merge remote-tracking branch 'upstream/master' 581e0495b lua -> Lua, luajit -> LuaJIT, and fixed some minor typos a34f9b6ea bugfix: gcc 4.6 complaint about comparing size_t values with off_t values. 754d547ca bugfix: ngx.req.socket() did not honor the "Expect: 100-continue" request header and could hang. thanks Matthieu Tourne for the patch in pull request #107. 21450b7c5 bugfix: the ngx.req.socket() object (i.e., the downstream cosocket object) did not work with HTTP 1.1 pipelined requests at all. e7f56d021 bugfix: downstream cosockets might lose the last part of the request body when receiving data. this regression had appeared in v0.5.0rc25. thanks Matthieu Tourne for reporting it. 9144d2487 Fix receiveuntil("pattern", { inclusive = false }) 8cd749f33 Adding failing test 8e6877379 minor coding style fixes in the patch for adding Lua backtraces. also added 073-backtrace.t to test it. see github pull request #107. f079f8b3a Adding trace to errors dbe0dc4e4 now we call ngx_http_lua_socket_finalize in cosocket:setkeepalive() to help buffer reuse. d00976d80 bugfix: nginx could crash on request fialization when running the cosocket cleanup handler due to the lack of check of the ctx pointer. thanks shaneeb for reporting this in github issue #110. b440e5b2d updated t/024-access/exit.t a bit. d4b111b61 Merge remote-tracking branch 'upstream/master' 8f1b3d9aa added a test for If-Unmodified-Since and 412 error page. eeb1816c6 optimize: now ngx.log is much faster when the log level argument is lower than the actual error_log level specified in nginx.conf. thanks Matthieu Tourne for providing the patch. 02b1db9e5 minor optimizations. 0ceb1045f added (passing) tests for conditional GET requests. decdf0129 added error log tests to t/044-req-body.t. e9a5eb1a0 bugfix: ngx.req.get_body_data() could not handle multi-buffer request bodies and discarded the body data after the first buffer. df32739d0 fixed test index in 024-access/subrequest.t. 8e2faf71b added tests to expose the bug in the nginx core reported by drdrxp in agentzh/nginx-eval-module#1. becf72a1a added a (passing) test for github issue #110. 34a36afa1 Adding documentation for the receiveuntil option { inclusive = true } 20b339571 Adding logic for the receiveuntil option { inclusive = true } ef8e2bf8c Adding test for inclusive mode add1a0ad8 updated .gitignore. 9e935ee31 add skeleton of coroutine api 2db0ae306 Merge remote-tracking branch 'upstream/master' 77eb00333 Adding README.markdown 1901199ad Adding log_by_lua and log_by_lua_file and documentation 8d287851e bugfix: the previous patch for using ngx.ctx in set_by_lua* could result in memory leaks; now we ensure that the request cleanup handler is always registered when set_by_lua* is used. ef9112084 added error log tests to 033-ctx.t. bee1cabcb bugfix: ngx.ctx was not accessible at all in set_by_lua*. thanks Pierre. 4e56036c2 minor code refactoring. 004b7c8ba bugfix: fixed typo "on-array", which should be "non-array", in an error message. 6de0c1c6c bugfix: cosocket connections from the connection pool might lead to segfaults if it is not used immediately. thanks xukaifu for reporting this as github issue #108. 370955d21 removed too restrict timeout settings in the test suite. c7ec9c97d bugfix: debug logging in the cosocket receive line method could lead to invalid memory reads under extreme network conditions. this issue was caught by mockeagain in reading mode. f3f561f1e updated valgrind.suppress for linux i386 further. 76bf73c7e updated valgrind.suppress. 200bac2c2 test: enlarged resolver timeout for the cosocket tests even more. 7667027d4 enlarged resolver timeout for the cosocket tests. d611eeee7 added more error_log tests for the cosocket tests. 776f4999d Merge remote-tracking branch 'upstream/master' e0eea5355 Fix issues with POST using http 1.1 (test for expect) b80b502be Adding ngx.req.init_body() ngx.req.append_body() ngx.req.finish_body() a12d72f25 Adding "variable" $ngx_prefix to lua_package_path 2ee6f4694 Adding trace to errors fa3eeb01a Adding directive rewrite_no_postpone 2bb9d6fd8 still use 2 sec as the resolver timeout setting in 058-tcp-socket.t TEST 8. e442e7661 fixed tests for mockeagain in reading mode. 00d05f26d bugfix: downstream cosockets might hang on the receive(size) method call for slow connections. mockeagain in reading mode caught this issue. 1c0e24a3c various fixes in the test suite. 4591dc704 Merge branch 'master' of github.com:chaoslawful/lua-nginx-module 6667bf628 feature: made ngx_http_lua_api.h visible to other nginx modules by adding src/api to the CORE_INCS variable value in the config file. thanks Brian Akins for suggesting this in github issue #105. 8a6fc75fa change lua_pop macro to lua_settop function in gdbinit script a84e94623 added support for PCRE_INC and PCRE_LIB to the developer build script. 1cb522d49 fixed the developer build script. f5aaee3d6 updated .gitignore. 43cac16e5 renamed ngx_http_lua_add_preload to ngx_http_lua_add_package_preload; also added new public C API ngx_http_lua_get_global_state, as suggested by Brian Akins in github issue #100. 6e9277404 minor code refactoring: we no longer include ddebug.h in common.h; and we put publich API functions into ngx_http_lua_api.h and ngx_http_lua_api.c. 5692c8f39 Merge pull request #101 from bakins/ngx_http_lua_add_preload caecbe2e5 add gdbinit script to ease lua debugging 95aa6577c Merge branch 'master' of https://github.com/chaoslawful/lua-nginx-module 6ff5df616 updated docs to reflect recent changes (documented the ngx.HTTP_OPTIONS constant). 68638bd3a feature: added new constant ngx.HTTP_OPTIONS for the HTTP OPTIONS method; also added support for OPTIONS method in the subrequest capture APIs. thanks Jónas Tryggvi Jóhannsson for requesting this in github issue #102. 2b3f5f90e bugfix: we no longer forcibly quit the lua threads by clearing out its environment and running it blindly to the end because Lua GC will collect all those unfinished coroutines anyway. 4cfc2488f bugfix: improved the longjmp handling. 31378f14f add ngx_http_lua_get_request f7003733b add ngx_http_lua_add_preload e96822a5a bugfix: certain compilers might complain about missing declarations for types like int8_t. now we explicitly included stdint.h. thanks runner-mei for reporting it in github issue #98. 19bd32224 cosocket: various optimizations in timeout handling. this gives about 2.5+% performance boost in some benchmarks using lua-resty-redis and lua-resty-mysql. c74667407 updated docs to reflect recent changes. bbac7d623 bugfix: made the sha1 library an optional dependency, as suggested by runner-mei in github issue #94. 1a1cde4ca fixed a coding style issue: we did not declare C variables at the beginning of the current code block in ngx_http_lua_del_thread, reported by runner-mei in github issue #93. e84711d08 bugfix: incorrectly used ngx_conf_log_error by using NGX_ERROR as the first argument, as reported by runner-mei in github issue #92. 37f749eb2 fixed typos in lua exception messages. 2ac3aa2a0 updated docs to reflect recent changes. c9c5f9486 Merge branch 'master' of github.com:chaoslawful/lua-nginx-module b4c2a37d3 fixed 061-lua-redis.t a bit. 1dc6c21e4 minor coding style fixes. 6de0dae34 feature: added new directive lua_http10_buffering which is on by default. 58cd006b0 fixed a test case in 024-access/satisfy.t. ee0bf0b89 feature: added new constant ngx.DECLINED. bugfix: access_by_lua could not work with the "satisfy" config directive. b6a6d5b1b Merge branch 'master' of https://github.com/chaoslawful/lua-nginx-module 04332d929 optimize: now we recycle the special flush buf and chain link for ngx.flush() to prevent request-scoped memory leaks when emitting long data streams to the downstream. 58cd7f0f2 added a (passing) test case for multi-value args to ngx.req.set_uri_args. 3dfd00aff bugfix: timestamp could overflow on 32-bit systems in the shared dict API; now we use 64-bit integers. fcfdd73d2 documented the shdict:flush_all() method. ae7b5e972 shdict: now we aggressively remove three items from the store in the flush_all method. 17bb70935 improved Weiqiang Li's patch by fixing the coding style and avoiding unnecessary operations. also added a test case for the new flush_all method. f5d9b6c90 add flush_all api to shared dict 2b37a7c7a docs: documented the max concurrent subrequest count limitation and max error log line size limit. 9da8286df added a test case for emitting large messages via ngx.log(). 215a9f7af updated docs to reflect recent changes. 3ff937f3a bugfix: the shared dict storage might leak memory in the store: ngx_http_lua_shdict_lookup incorrectly assumed that nodes with identical keys are linked together, which might not be true after tree rebalance. thanks the patch from Lanshun Zhou. 261020646 optimize: removed a redundant piece of code for subrequest headers_in fixes in ngx_http_lua_adjust_subrequest. f21bd80b0 bumped the version number in docs. 99b02286f now we use the buf tag literal everywhere and removed the "tag" field from the location conf struct. ec4becfea bugfix: the exptime argument to shdict:set/add/etc methods was incorrectly ignored when the flags argument is also specified. thanks the patch from Brian Akins. 81f1d7ca4 fixed typos in docs. thanks 王斌. 6c713ea68 removed an unnecessary line of code. 34f8f272c updated docs to reflect recent changes. cdcbef310 Merge branch 'master' into cosocket ef311cd1c updated developer build script. 003650d1b bugfix: fixed a debug log message. e8aa2495f bugfix: for big input data, the cosocket reading methods could result in crashes due to incorrect use of luaL_Buffer. now we eliminate luaL_Buffer altogether by managing the recv buffers ourselves. the recv buffers can also be recycled. 87ebe182f updated the developer build script. 32e8ad4e1 bugfix: fixed various typos in source comments also avoided using luaL_checkstring which could do another longjump on its own. thanks 王斌. 67c79c0d2 added tests for cycled subrequests; also increased the "repeat_each" count in 027-multi-capture.t to make an issue with too small MAX_SUBREQUESTS easier to reproduce. aaab8c750 fixed shdict tests on i386; also ensure to configure "postpone_output 1" for the sync flush test case that requires buf reuse. e7f8eb729 bugfix: tcpsocket:setkeepalive() will return errors when the current connection has readable data or there is still unread data in the ngx_lua upstream buffer. bugfix: cosocket methods no longer explicitly return nil error strings upon success. ae6b59a0a refactored the test suite a bit. aa4bd3878 bugfix: when the parent request takes a request body, the subrequest does not take any bodies, and the subrequest's method is neither "PUT" nor "POST", then the subrequest will no longer inherit the parent request's request body. thanks 欧远宁 for reporting this issue. 9026d59fd bugfix: data might be accidentally read into the lua space on idle sockets when the last operation is a read operation *and* a read event suddenly arrives for edge-triggered event models. the same might also apply to write operations too. bugfix: invalid reads might happen in the reading iterators returned by the receiveuntil() method which could lead to segfaults. 1bce88568 added tests for the various "lua socket blah blah timed out" error messages; also tweaked other cosocket test cases for different test modes. f95c55f7a bugfix: "closed" error would occur for long-running requests that hold the idle cosocket object for a period of time that is longer than the read timeout setting: we should delete the read event timer in time when the receive call has already got a read event. thanks 欧远宁 for reporting this issue. 1b702e540 added error logs for socket timeout errors. 78ed3f573 added error logs for closed errors. 7cb4e0957 introduced a minor optimization that we can save one recv call when the read event is active *and* the read event is not ready. e633e75d9 Merge branch 'master' of github.com:chaoslawful/lua-nginx-module fc7893d05 now we recycle the downstream output buffers to save memory and dynamic allocation times for long-running requests. 60e70ef7e bugfix: now we require the SHA1 library in the "config" file. 060e9bf49 Merge branch 'devel' d4167c1a1 bugfix: macro directives were used inside a macro argument which made gcc 3.2.3 unhappy. thanks Feng Bin. 11a13f069 bugfix: cosocket API could not be used before ngx.location.capture and its friends for fast network access: tcpsock:send() method did not reset u->waiting properly. thanks 欧远宁. 89af745e1 updated docs to reflect recent changes. cbc1fd22a add gdb script to ease Lua debugging 96e9b3038 feature: allow use of ngx.null in ngx.log() and print() arguments. 2f1c2a5e0 opt: fixed the "ngx." table initializing sizes. d29c611c8 bugfix: could not compile with nginx 0.8.x. thanks 欧远宁. 25abe98ca feature: added the ngx.sha1_bin method which returns the binary form of the SHA-1 digest. 60335f37b minor fixes in the tests. 2614f3ffd bugfix: we incorrectly allowed ngx.null in the string table argument to cosocket:send() method. c73f87480 updated docs to reflect recent changes. 14e079cca fixed ngx. table entry count during table initialization. 2c5a75838 feature: added constant ngx.null which is a NULL light userdata to represent "nil" values in lua tables and etc. this is compatible with at least lua-cjson library's cjson.null constant. 51a6bdfad minor coding style fixes. e3123d322 Merge branch 'last_modified' cef799110 add last-modified test 90ae31516 last modified jumbo d1085f9e9 fixed typos in docs. thanks @cyberty. a8cad73ed updated docs to reflect recent changes. 1d7626f42 cosocket: feature: now cosocket:send() method supports lua tables of string fragments which can save unnecessary string concatenation operations on the lua land that are usually quite expensive. 907f825a4 cosocket: fixed bugs in debugging logs. 5a3e31777 updated docs to reflect recent changes. 1e8f8e5f5 Merge branch 'dict_flags' 8d576f2ce use uint32_t as the type of shdict user flags. c8967e5a6 match new error message 9ef0b86d6 do not return flags if not set for backwards compatibility 24177e8ed expect nil de5e7bf19 user flag test edc9633d9 Add user flags 170c5484e updated docs to reflect recent changes. ef46b7f33 cosocket: documented the in-pool connection monitoring feature requested by @ldmiao. 653d1ec1f bumped the version number in docs. 750b92809 cosocket: reverted casual changes to the developer build script in the last commit. 1cec50410 cosocket: bugfix: fixed -Werror=unused-but-set-variable warnings from gcc 4.6. 07329405e cosocket: bugfix: when the object returned from ngx.req.socket() is used across the request boundary, segfault would occur; so now we protect the downstream cosocket object from being used outside the current request lifetime. 72f7fb5b0 cosocket: documented the ngx.req.socket() function. 0b99b3505 cosocket: documented the sock:receiveuntil method. 44459f5dd cosocket: documented most of the cosocket API. c6f165e39 cosocket: added a (passing) test for keepalive unix domain sockets. bc4baee25 Merge branch 'cosocket' 204ce2b3d updated docs for the v0.4.1 release. 9e30acfec cosocket: fixed compilation failures without --with-debug: misuse of the ngx_log_debugN macros. 7848542c8 cosocket: added a test case for extremely small buffers when calling sock:receiveuntil. a6183a1a0 minor tweaks in tests. 8d7cc5fba cosocket: optimized the chainlink and buf recycle logic for the subrequest API and cosocket API. ba7a62fbb cosocket: bugfix: the request cleanup handler could access the (invalid) upstream userdata after Lua GC frees it. also fixed the lua table initialization for ngx._tcp_meta. 3bb79438c cosocket: feature: implemented "timeout" and "size" arguments to the setkeepalive() method to override the config settings via the directives lua_socket_keepalive_timeout and lua_socket_pool_size. 2bb7ba793 cosocket: check zero connection pool size. d65eeee42 cosocket: feature: "lua_socket_keepalive_timeout 0" now means unlimited connection idle time. ce5b54349 cosocket: added tests for the default lua_socket_pool_size value (30). fa07de06c cosocket: feature: added config directive lua_socket_pool_size to control the connection pool size (in terms of number of connections) per host-port pair. bc8a9097d cosocket: added debugging output for keepalive timeout values. 154fce40d Merge remote-tracking branch 'origin/master' into cosocket fb3d82db9 Merge branch 'master' into cosocket f1269407d cosocket: bugfix: we did not reset c->read->handler and c->write->handler for connections got from the connection pool which could lead to segfaults; feature: new config directive lua_socket_keepalive_timeout to specify the max idle time for connections in the pool. a95e02faa bugfix: ngx_http_lua_header_filter_init was called with an argument which actually accepts none. this could cause compilation errors at least with gcc 4.3.4 as reported in github issue #80. thanks bigplum (Simon). 9d5e827c7 cosocket: call ngx_close_connection() directly instead of introducing ngx_http_lua_socket_keepalive_close(); also added a (passing) test case for premature close of upstream sockets for idle connections in the pool. dcd633f97 cosocket: fixed connection pool cleanup logic and added support for max idle timeout. 5b2a977b3 cosocket: initial prototype for the builtin connection pool support via the new cosocket method "sock:setkeepalive()". also always reset u->length and u->rest for the "sock:receive()" method. e60a94814 cosocket: did a minor optimization for receiveuntil patterns no longer than 2 bytes. 7a4cbfb4a cosocket: bugfix: fixed a minor inconsistency in the reading iterator returned from sock:receiveuntil when the "size" argument is specified. also added some (passing) tests for a true multipart parser. 54a6f750d cosocket: use 8.8.8.8 as the default TEST_NGINX_RESOLVER env value in the test suite. 4cecc53e3 cosocket fixed a typo in ngx_http_lua_socket_read: we should use r->headers_in.content_length_in instead of r->content_length_n. 9a7a12a46 cosocket: fixed lua table entry count in table initialization. bc93b61f7 cosocket: minor coding style fixes. 83d972e38 cosocket: bugfix: request sockets reading should honour the Content-Length request header (if any). 7bd0fdbeb cosocket: feature: ngx.req.socket() works. 9c461bf15 fixed lua table initial entry count; also added initial skeleton for ngx.req.socket() but not working yet. 9e4abfdcd minor test fixes. 2f20b7acd cosocket: added support for the "size" argument to the reading iterator returned by the sock:receiveuntil(). 51b793007 cosocket: introduced a minor optimization that we could save the first two elements in the cp->recovering array. 38c4fa074 cosocket: added a lot more tests for sock:receiveuntil. b045cfae4 cosocket: bugfix: use the luaL_addchar macro to simplify the state machine logic. d8548e4a4 cosocket: decreased memory usage for unambiguous boundary patterns in sock:receiveuntil(). 9a673b787 added support for ambiguous boundary patterns. 19b071c3e feature: first cut on the socket:receiveuntil(pattern) method. ambiguous boundary patterns and the "size" parameter to the reading iterator are not implemented yet. 92e0e6ef0 added (passing) test cases for cosocket send timeout settings. 75a52b465 RecvUntil.pm: fixed Makefile. 30a17916c checked in a perl prototype for the receiveuntil method implementation. 17ee6b60c updated .gitignore. 884ae49bf feature: implemented method settimeout() for ngx.socket.tcp() objects. 7962a9fb1 Various fixes in cosocket b1b92000b fixed test index. a2859d4fe fixed test index. 735355c98 Merge branch 'master' into cosocket 6e8c4aba5 renamed .t files. 30cf86dd6 merged master to cosocket. dc37474df bugfix: fixed all the warnings from the clang static analyzer. fb84d6fe0 adjusted the tests a bit. 733d26d16 bugfix: ngx.exit, ngx.redirect, ngx.exec, and ngx.set_uri(uri, true) could return (they should never return as per the documentation). this bug had appeared in v0.3.1rc4. thanks @cyberty for reporting it. b166210bc added change log for v0.4.0 and also documented the way to confirm that pcre jit is actually enabled. bc9142cb3 allow use of the DDEBUG macro from the outside (via the "-D DDEBUG=1" cc opton). 7bdd8505b updated README. 37c4880eb docs: massive wording improvement from Nginx User. e43eab96a now we state that ngx.re API requires pcre 8.21+ for its regex JIT support in the docs. 805f6a24a updated docs to reflect recent changes. 11ddbdf9f added debug logging when ngx.req.get_headers() hits header count limit. d40fcc669 added debug log when ngx.req.get_uri_args and ngx.req.get_post_args hit max args limit. 8e8517c64 updated valgrind.suppress a bit. 85f876ec1 bugfix: hash table collision attacks were possible in ngx.req.get_headers() and now it only parses at most 100 headers (can be controlled by the C macro NGX_HTT_LUA_MAX_HEADERS. ngx.req.get_headers() now also takes an optional argument that can be used to specify a custom header count limit (defaul to 100). one can disable the header count limit altogether by feeding ngx.req.get_headers() with a zero value argument. 0ece0793e added more tests for max_args argument. 3a2b80b05 tweaked the timeout settings for two test cases. 75876b67c bugfix: ngx.req.get_uri_args and ngx.req.get_post_args now only parse up to 100 arguments by default. but one can specify the optional argument to these two methods to specify a custom maximum number of args. thanks Tzury Bar Yochay for reporting this. 2b18629c2 bugfix: removing builtin headers in huge request headers with 20+ entries could result in data loss. thanks Chris Dumoulin for the patch. f9efd3288 bugfix: ngx_lua could not compile with nginx 1.1.12+. thanks deltay for reporting it in github issue #76. b0f158232 fixed the test cases regarding invalid escape sequences for LuaJIT 2.0.0 beta9. 81b9bbb51 Merge branch 'master' of github.com:chaoslawful/lua-nginx-module 6f9a1f9b7 now we use pcre 8.21 jit build in the developer build script. 33844f1b8 fixed a test case in t/057-flush-timeout.t on FreeBSD. f6ea32e0e removed --with-cc=gcc46 from util/build2.sh. 4f0d035cd updated docs to reflect recent changes. thanks Nginx User. 78014b647 bugfix: request header value strings must be null terminated and was possible to introduce memory invalid reads in the past. thanks Maxim Dounin. 66d35ae23 cosocket: fixed the lua-redis test case a little. a5e501045 cosocket: fixed ngx_log_debugN for non-debugging builds. also added a passing test case for running Daniele Alessandri's lua-redis library by emulating LuaSocket via ngx.socket :) 166a71112 cosocket: we now allow string-typed size argument for sock:receive(). also added a (passing) test case for running Neil Richardson's lua-memcached library by mocking LuaSocket with ngx.socket :) 74738a721 cosocket: minor coding style fixes. 976d3e1fd cosocket: implemented the ngx.socket.connect() shortcut. 7ec21aeea cosocket: fix buffer recycling logic for the "receive" method; also added "buffer too small" error handling. 66f4d22e1 cosocket: fixed receive(n) to only return exactly n bytes of data as per LuaSocket's behavior. also made receive() return the 3rd value for the partial result when error occurs, just like LuaSocket. aeaddfe41 cosocket: implemented the number-typed pattern parameter for the "receive" method as per the LuaSocket TCP API. 592a53446 cosocket: fixed resolver error handling for cached negative results. 3ca2a900e cosocket: implemented the "*l" and "*a" pattern argument for the receive() method as per the LuaSocket TCP API. 072456997 cosocket: fixed resolver error handling a bit. ecb161cf0 Merge remote-tracking branch 'origin/master' into cosocket f63c91437 Merge branch 'master' into cosocket 83a1e64a4 cosocket: added a (passing) test case for resolver timeout handling. f79766317 cosocket: fixed bugs in resolver failure handling. 9b21eb38d cosocket: various coding style fixes. 5353b5bd3 cosocket: various fixes in the unix domain socket support. 33fcd577b bugfix: ngx.var.VARIABLE might evaluate to nil even if there is a valid value because the nginx variable value's valid flag might not be initialized properly. this bad had appeared in v0.3.1rc40. 4e4fe381c cosocket: fixed timeout handing in the connect() method. 6da957c93 now we return the errstr "closed" when manipulating a closed socket object, just like LuaSocket. 202336c40 better socket errstr handling. c0e379575 added a (passing) case to test the "connection refused" error. 1810fb0bc eagerly free u->buffer in ngx_http_lua_socket_finalize. 32b1a5899 cosocket: now we support unix domain socket address for the "connect" method; also improved the error messages. 4b65f824c first cut on the nginx builtin nonblocking resolver support for ngx.socket.tcp(). eea55f590 implemented the socket:close() method. 978c9779b bugfix: socket:receive() will ignore all the CR char in the inputs, just like LuaSocket. 1afdd5265 turned off ddebug and also fixed source lines exceeding 80 cols. 6c0edbd84 fixed a serious bug in socket:receive(). the test case is passing for multiple receive calls. fa1d4b5f1 completed the first cut on the socket:receive() method. the first test case is now passing, but sock:receive() is still buggy. 37d7fd457 now we use dummy handler as the read/write event handler wherever possible (a complete fix would require deleting and adding read/write events for level triggered event models). 563e14b1a ngx.socket.tcp()'s send method is mostly working now :D c6113b309 added new directives lua_socket_connect_timeout, lua_socket_send_timeout, and lua_socket_read_timeout. only really implemented the first one ;) 04e3122de minor fixes in socket:connect(). 220af136e socket:connect() kinda works. 37cc4a24a updated valgrind.suppress further for Valgrind SGCheck. 709d62db3 updated valgrind.suppress further for Valgrind SGCheck. f0faa955e Merge branch 'master' into cosocket 4fc7a965c updated valgrind.suppress for Valgrind SGCheck. 9161a993b bugfix: more_set_input_headers did not handle the Accept-Encoding request headers properly. thanks 天街夜色. 29e8b41e9 bugfix: there were various places where we did not check the pointer returned by the memory allocator. b35bcb2d6 updated README and README.markdown. e9de829c9 docs: updated docs to reflect recent changes. thanks Nginx User. b1d8d6227 bugfix: ngx.flush(true) could not be used before I/O calls like ngx.location.capture. this bug had appeared in v0.3.1rc34. 9e811fbbb more work done on the cosocket scaffold. 0e1770ac4 initial scaffold for ngx.socket.tcp(). also did minor optimization for the "ngx" table and the metatable for "ngx.shard.DICT" objects. 2c6a22a29 fixed some small bugs in the ngx.socket.tcp test case. a44b8ce96 added a test case for the ngx.socket.tcp API. not passing yet. 8153df5c6 bugfix: ngx.var.VARIABLE evalues to nil when the nginx variable is purely invalid. ea24c93c8 documented ngx.HTTP_GATEWAY_TIMEOUT and also included edits from Nginx User. f88d229ce added a test for ngx.HTTP_GATEWAY_TIMEOUT. a3bc3fcee added constant ngx.HTTP_GATEWAY_TIMEOUT (504) per Fry-kun in github issue #73. 9cbf7c376 docs: massive documentation improvements. thanks Nginx User. 7a4617ff8 fixed two spots of gcc 4.6 warnings. c9f5e028b enable the default -O in the developer build script. a635ab8be bugfix: use of the ngx.re API might lead to errors like "pcre_compile() failed: failed to get memory" due to incorrect pcre_malloc and pcre_free handling. thanks Vittly for reporting this in github issue #72. 745b47fd2 more fixes in 057-flush-timeout.t 34ee97908 fixed the flush-timeout test script. bd1da870a bugfix: fixed ngx_log_debugN which fails to compile without --with-debug. thanks @ldmiao for reporting it. 47d977391 checked in the tests for the bug regarding connection timeout error checking fixed in the previous commit. 06fd57947 bugfix: now we check timed out downstream connections in our wev handler. 28ae78f0e updated docs to reflect recent changes. 09ccd15b5 feature: added "wait" boolean argument to ngx.flush() to support synchronous flushing; ngx.flush(true) will not return until all the data has been flushed into the system send buffer or the send timeout has expired. db85756a0 fixed gcc 4.6 compilation warnings by removing some dead code. 6b8c2d8a2 more docs love. 462633481 updated the docs to reflect recent changes. thanks Nginx User for polishing the documentation a lot. c598e718c feature: added new API ngx.update_time which calls ngx_time_update in the Nginx core. 79a19650a reformatted the tests. 2a134b179 omitted unnecessary checks in our lua hooks. 11617ee1e Merge remote-tracking branch 'origin/master' into ngx-now 1e7bd81f5 fixed the test case for ngx.now 08318e606 add missing test file for ngx.now d6ae4883b feature: added "ngx.now" for get time with msec(float) 5fcb1a7b8 updated docs to reflect recent changes. 806a99a3f feature: added opions "copy_all_vars" and "vars" to ngx.location.capture and ngx.location.capture_multi. thanks Marcus Clyne for the patch; also fixed a bad regression in ngx.location.capture_multi when the request option table is specified. c43d510fb updated docs to reflect recent changes. thanks Nginx User. 881a0ae60 fixed a gcc 4.6 warning. 3e0c15ace reverted build2.sh. 4db4603b1 fixed a gcc compilation warning for pcre < 8.20. 99f45c46c now we check if pcre jit indeed works by scanning error.log in the related tests. 951103f3b tested the "d" and "j" regex options for DFA and JIT modes for ngx.re.gsub. 5c2a86cb3 now "j" and "d" regex options are confirmed to work with ngx.re.sub(). c444de8e4 ngx.re: now we disable jit automatically when in dfa mode. 85fb303ff bugfix: ngx.re.gmatch may free the pcre study data too early when the "j" option is specified to enable pcre jit, which might cause crashes. 5a729fca9 coding style fixes. 85a74e068 fixed pcre pool management in the cleanup handler. df000b92d feature: ensured that the "j" (JIT) option for ngx.re.gmatch works properly. 8f28c7f0a turned off ddebug. f360e6903 feature: implemented "d" and "j" regex options for ngx.re.match to enable PCRE DFA mode and JIT mode, respectively. thanks @姜大炮. the support of these two new options in ngx.re.gmatch, ngx.re.sub, and ngx.re.gsub is currently broken and needs fixes in future commits. 457280136 massive documentation improvements. thanks Nginx User. 09fc7c73e tweaked drdrxp's hmac-sha1 patch a bit and also added a test case for it. fd47016fa Merge remote-tracking branch 'drmingdrmer/hmac' into hmac 6dd6f02e0 updated valgrind.suppress a bit. 5beba3733 add ngx.hmac_sha1 a5dc446cd tweaked the developer script a bit. efd374014 bugfix: Cache-Control header modification might introduce empty value headers when using with the standard ngx_headers module. ae29491dd added one more passing test. fa5cafdcf updated docs to reflect recent changes. 64a2b730a renamed ngx.req.encode_args to ngx.encode_args. 1259fbc81 fixed various issues in shrimp's commits for ngx.encode_query_args. also renamed ngx.encode_query_args to ngx.encode_args. 131f13d6b Merge branch 'master' into args 82c566aae confirmed that we work with nginx 1.0.9. 860199f99 updated docs to reflect recent changes. 30a2e898e minor tweaks. b92cbf456 ngx.req.encode_query_args is now supporting args value to be lua table f0942d7a3 Merge branch 'master' of github.com:chaoslawful/lua-nginx-module into args c3a6737b7 add encode_query_args function into ngx.req e5c62d084 added one line of comment. dc49eb206 feature: added "ctx" option to ngx.location.capture: you can now specify a custom Lua table to pass to the subrequest as its "ngx.ctx". thanks @hugozhu. 9942742eb made tests more stable. 4d92cb158 fixed compatibility with nginx 0.8.54. thanks 郭颖. 74755eb0e bugfix: ndk.set_var.DIRECTIVE had a memory issue and may pass empty argument values to the directive being called. thanks dannynoonan. 1eb73d67c updated docs to reflect recent changes. edde16355 now incr returns the new numerical value as its first return value. d01adf7d7 now we still enable --with-debug in our developer build script. 259524953 fixed compilation warnings without --with-debug for gcc 4.6.0. a9842859b fixed another spot of -Werror=unused-but-set-variable warning issued by gcc 4.6.0. 9656a97f0 fixed one spot of -Werror=unused-but-set-variable warning issued by gcc 4.6.0. 24da18171 feature: implemented new methods "add", "replace", and "delete" for ngx.shared.DICT. also made the "set" method return 3 values: "success", "err", and "forcible". a935e6fdb enable the ngx.shared API in set_by_lua* and header_filter_by_lua* too ;) 9c26604bf documented the shared dictionary API. d4224b979 no longer set too many worker connections in t/030-uri-args.t. d7c8be39c fixed test cases for 32-bit systems. e6f600275 reindexed the tests. 8d31d75cc shared_dict set: now we try harder when failing to allocate new entry by forcily removing up to 30 least recently used entries. aad4815f7 shared_dict: now we use uint8_t for value type and uint32_t for value_len. 4518fcf71 implemented shared_dict set nil, which effectively removes the key from the dict. b9d28596d now we support 0 expiration time to denote infinite expiration time in shared_dict set. and it is default to 0 when the set method does not take an "expire" argument. f32e5ed8f added more tests for various error cases and LRU. 192ec1e9d bugfix: shared dict get: we should not unlock the mutex too soon. thanks drdrxp. 2549ab48e added more (passing) tests for the shared dict API. f5a4f7243 the shared_dict get and set are now complete and usable :D b71a0b52a resolved conflicts while merging the "master" branch to "shm". 5973268d3 updated docs and turned off ddebug. d3e601fc9 added tests for setting ngx.var.VAR to nil values. 3638fd09c bugfix: no longer free request body buffers that are not allocated by ourselves. 61b9d83fe now we allow setting ngx.var.VARIABLE to nil. a79cc7500 added a small test case. b25d06b32 improved the README file's formatting. 58d6bc91e fixed reading size_t as an off_t in ngx.req.set_body_data() which may lead to memory issues on 32-bit systems. 0a8a11b99 put the debug log outputs to the right place. 739825a7c no longer set the NGINX_ALLOW_REQUEST_BODY_UPDATING macro in developer build script. f03ac7ca3 fixed -Wset-but-not-used warning issues caught by gcc 4.6.0. 0cb010bb3 bugfix: lua_need_request_body should not skip requests with methods other than POST and PUT. thanks Nginx User. 8eef13e10 updated docs to reflect recent changes regarding the request body API. 5cef7124f no longer use the NGINX_ALLOW_REQUEST_BODY_UPDATING macro and r->content_length_n. now calling ngx.req.read_body() after ngx.req.discard_body() is a no-op. ad0300696 fixed compatibility with standard nginx. 5c36f6e8c now we complete the work for ngx.req.set_body_file(), ngx.req.set_body_data(), and ngx.req.discard_body(). 893f7e72a now we also override Content-Length for ngx.req.set_body_data(). 2fbea05b9 initial cut on the ngx.req.set_body_file() API. ea81bb2f0 implemented new function ngx.req.set_body_data() to override the current request body with in-memory data. 1122cbd49 fixed a test cause because Test::Nginx fixed a bug in its Content-Length handling. a0a9fb49a documented the new APIs: ngx.req.read_body(), ngx.req.discard_body(), ngx.req.get_body_data(), and ngx.req.get_body_file(); also improved the coding style and the test suite a bit. 569e3511c added (passing) tests for ngx.location.capture + ngx.redirect under http pipelining. 982cb581a refactored the code for access_by_lua and access_by_lua_file to reduce code duplication. 2c9a564a4 refactored the code for rewrite_by_lua and rewrite_by_lua_file to reduce code duplication. b6c7dd053 bugfix: fixed hanging issues when using ngx.exec() within rewrite_by_lua and access_by_lua. thanks Nginx User for reporting it. b0474ca75 implemented new function ngx.req.get_body_file(). aefb1c490 implemented new method ngx.req.get_body_data. 38c832593 implemented ngx.req.discard_body() function to let user lua code to discard request body. 18f30a16a now we use ngx_http_block_reading instead of ngx_http_empty_request handler or read event handler. 0f18d9936 implemented ngx.req.read_body() which does synchronous non-blocking request body reading in full buffered mode. b45910b44 minor code refactoring. b298984e0 fixed compilation failures when --with-debug is turned off. 6c1c1666b now we prohibit use of true jump argument in ngx.req.set_uri() in contexts other than rewrite_by_lua and rewrite_by_lua_file. a lua exception will be thrown if the context is incorrect. 6ff491bd1 now we change the ngx.req.set_uri() API a bit by changing the optional argument "break_cycle" to "jump". so now it will not trigger location jump by default (because "jump" argument is false by default) and in case "jump" is given true, the function will re-search locations and jump to the new location and never return. 6be7dad62 added more complex samples to the docs for ngx.req.set_uri(). 89dcc5b8d documented the new APIs ngx.req.set_uri() and ngx.req.set_uri_args(). thanks Vladimir Protasov (utros) and Nginx User for suggesting this feature in github issue #62 and the nginx mailing list, respectively. f72eb473c documented that rewrite phase Lua code will be skipped if location re-lookup is triggered by the standard ngx_rewrite module's rewrite directive. thanks Nginx User. 95faaaa2d now we skip rewrite phase lua handlers altogether if ngx_rewrite's rewrite directive issue a location re-lookup by changing uris (but not including rewrite ... break). a2d115e65 added more (passing) tests for ngx.req.set_uri and ngx.req.set_uri_args. 2df39a9e1 now we implemented ngx.req.set_uri() and ngx.req.set_uri_args() to emulate ngx_rewrite's rewrite directive (without redirect or permanent modifiers). 0bb889956 updated docs to reflect recent changes. 75f960b06 added constant ngx.HTTP_METHOD_NOT_IMPLEMENTED. thanks Nginx User. 3c4b1ff31 added one more (passing) test case. c5fbee750 now we explicitly clear all the modules' contexts before calling ngx_http_named_location. 0457ff206 more treatment of the previous fix. 8f8496419 fixed the download page links in docs. e5b8c8f46 bugfix: calling ngx.exec() to jump to a named location did not clear the context object of ngx_lua properly and might cause evil problems. thanks Nginx User. 4c7176876 turned off the master mode. d5e164208 the first test case is passing! b77bf67fc first cut on the shared dict feature. 65e475965 updated docs to state that we work with nginx 1.0.8 and 1.1.5. 05fbec643 updated developer build script a bit. 0ebffdfb4 no longer set header hash to 1. use ngx_hash instead :) c3acd88c2 minor style fixes. 8b586da4f fixed regression in the last commit: we should hash the header key, not value. 32efa828b we should not set header->hash to 1, we should use ngx_hash_key_lc to generate it. 4ad6d40e0 updated .gitignore. bb2539bb5 now we properly support setting the Cache-Control response header via the ngx.header.HEADER interface. eac237f88 fixed a test case for HTTP 1.0 streaming output. 3cbf39f3a now for HTTP 1.0 requests, we disable the automatic full buffering mode if the user sets the Content-Length response header before sending out the headers. this allows streamming output for HTTP 1.0 requests if the content length can be calculated beforehand. thanks 李子义. 752be5db1 use lua_Number instead of lua_Integer for crc32 functions' return values because 32-bit signed integers are too short for the crc32 digest. 0727d20dd documented the ngx.crc32_short and ngx.crc32_long methods. 9e043c690 exposes the CRC32 API of the Nginx core to the Lua land, in the form of the ngx.crc32_short and ngx.crc32_long methods. thanks @Lance. 6800229f0 documented the new feature that ngx.exec accepts a Lua table as its "args" argument value. fffdb9317 turned off ddebug. 2b625542d now ngx.exec() supports lua table as the second "args" argument value. thanks sexybabes. 60a8b4a61 documented the new ngx.headers_sent API. 47bee750d implemented the ngx.headers_sent API to check if response headers are sent (by ngx_lua). thanks @hugozhu. ab61a0331 renamed ngx_http_lua_patch.[ch] to ngx_http_lua_pcrefix.[ch]. 319800188 even more refactoring of the lua hooks. 8a1367756 more refactoring of the lua hooks. 2684f5b07 massive refactoring of the lua hooks. 87f360c9f fixed doc formatting issues. f5c7c9d1d updated docs from wiki. 88b551d3d now we also return Last-Modified for the subrequest response object. thanks @cyberty and sexybabes. 259d378dd refactored ngx_http_lua_wev_handler a bit to make it smaller. cd53678b3 minor refactoring of the various lua hooks. 7a5016e6b fixed an issue in ngx.redirect, ngx.exit, and ngx.exec: these function calls would be intercepted by Lua pcall/xpcall because they used lua exceptions. now they use lua yield just as ngx.location.capture. thanks @hugozhu for reporting this. f147ba4e9 rewording the doc for ngx.exit a bit. ac24af7f0 documented the way to output error pages with custom dynamic bodies in Lua. thanks rik1083. 6c7e74fb6 Merge branch 'master' of github.com:chaoslawful/lua-nginx-module 0e2b7993b enlarged a timeout setting for one of our test cases. 71993f12a documented the reading ngx.header.HEADER feature. bdf56a9da * fixed a bug when setting a multi-value response header to a single value (via writing to ngx.header.HEADER): the single value will be repeated on each old value. * added support for multi-values of reading ngx.header.HEADER. * added more tests for reading non-existent response headers. b0c96e306 simplified the ngx.header.HEADER reading logic. but multi-value headers are still not supported yet. 577de863d implemented reading response headers: VALUE = ngx.header.KEY. 1a3b82be8 do not use ngx_flag_t in internal implementation. we use unsigned for boolean values consistently. 71fba5afb updated the documentation from wiki.nginx.org. 8dc5c9bb1 fixed a bug when the both the main request and the subrequst are POST requests with a body: we should not forward the main request's Content-Length headers to the user subrequests. thanks 朱峰. dd0d4d096 releng work for v0.3.0. 7e997bbbd added header_filter_by_lua test for config merge 9255687ef added test for overriding header_filter_by_lua config 8924e72f1 fixed bug, header_filter_by_lua didn't worked in server or http config 69da13b5d added more debugging outputs to the capture filters. 5a14de4a4 updated valgrind.suppress for archlinux. 864bf0274 removed those ugly lua_package_cpath from the exit.t test files. 8ef144d5c now we use lua-cjson in our test suite instead of lua-yajl. 951420328 renamed 050-header-filter.t to 041-header-filter.t. 4bdd15489 fixed -Wunused-but-set-variable warnings issed by gcc 4.6.0. 97d6c28a2 fixed test plan in ndk.t. eb666c15b marked nginx APIs available in the context of header_filter_by_lua* in the docs. 644b1da68 added more tests for header_filter_by_lua (confirmed that various APIs are properly injected). 138064090 added a (passing) test for header_filter_by_lua_file. 2b53d74b5 renamed the old filter.c to capturefilter.c. e4d00091a only register our capture header/body filters when relavant directives are actually used in nginx.conf. 010297e8f Merge branch 'header_filter' of github.com:chaoslawful/lua-nginx-module into header_filter 13d8ffe6e now we initialize the ngx_http_lua_requires_header_filter in pre config handler. 7d01579b7 Merge branch 'header_filter' of github.com:chaoslawful/lua-nginx-module into header_filter 210b38348 added more test for header_filter_by_lua e3ca6ee3a Merge branch 'header_filter' of github.com:chaoslawful/lua-nginx-module into header_filter 2a4a22d6f we will not register an access handler if nginx.conf does not use rewrite_by_lua* after HUP reload. 534dc1d9a we will not register a rewrite handler if nginx.conf does not use rewrite_by_lua* after HUP reload. f6cd4f54b added test for capture and header_filter_by 16606038d fixed some coding style issues. a7f05f3a5 cleaned up the API registration code. da21df069 merged master into the header_filter branch. d8b5cff81 Merge branch 'master' into header_filter 02d5ac66a refactored the Lua API injection code into groups. 0959786f1 added test for wrong lua code 4fa354eb2 Merge branch 'master' into header_filter a5b756c4f rename file name for ngx_links script 66fdc880f we should set the ctx->headers_sent flag after we have actually called ngx_http_send_header. this should pave a way to the new header_filter_by_lua* directives. c2cbbeac2 fixed issues for HEAD requests. a1aae4b11 checked in util/build2.sh. 06edf2a0d checked in util/build2.sh f6fa44f60 return NGX_ERROR after run lua failed in header_filter_by_lua f415f8186 go on next header filter when error found in header_by_filter 89af70819 fixed filter chain bug 2b1788528 added header_filter_by_lua command d41f205df updated docs in markdown and plain text accordingly. 0b733c4af explicitly documented the "ngx" and "ndk" standard packages introduced by this module, which are also the Nginx API exposed to the Lua land by ngx_lua. also documented the (new) ability to explicitly require them in the user Lua code. 4355225aa fixed a small formatting nit in the docs. 8e91a6a05 documented the new "o" regex option for the ngx.re.* API, as well as the new lua_regex_cache_max_entries directive. cc12d56e7 now we add "ngx" and "ndk" table into package.loaded such that the user can write "local ngx = require 'ngx'" and "local ndk = require 'ndk'". thanks @Lance. f291379d7 checked in t/040-gsub-o.t. 09afd869f fixed compilation errors while bulding nginx without --with-debug; splitted source lines exceeding 80 cols. 59eba8b24 implemented the "o" regex option for ngx.re.sub(). 1f1b0f0f8 implemented the "o" option for ngx.re.gmatch, so as to cache compiled regexes. 108cca013 implemented lua_regex_cache_max_entries directive to control the upper limit of the global regex cache size. when the user lua code is exceeding the regex cache, it will revert to non-compile-once mode and print out a warning to error.log 5d887904c added debugging outputs by ngx_log_debugN for ngx.re.match. e90a5a550 implemented the "o" regex option (i.e., the compiled-regex cache) for ngx.re.match(). 2097cef56 Revert "bumped the version number." de284ea91 bumped the version number. 6381eba76 splitted source lines exceeding 80 cols and also updated the docs from the wiki page. 75a9a0dbf Merge branch 'regex' 91f12efcf fixed a bug in the ngx.re regex API that look-behind assertions in PCRE regexes did not work properly. 3ef84e0f8 updated docs to reflect recent changes. e92921609 now we enable ngx.re.* regex API in set_by_lua* too :) 9eda6ccc7 minor tweaks of the tests. 16aa083ca fixed < and > symbols in the markdown docs. 3ce0b7a24 updated links in the doc. e0b45fe69 use HttpBlahModule instead of NginxHttpBlahModule in the doc. 7f09f235a renamed the wiki file. 39556de94 fixed issues found by gcc 4.6 -Wunused-but-set-variable warnings. f3653cede fixed github issue #52: compile error with nginx 1.0.5 on Ubuntu natty. 188cd4103 documented the new ngx.re.gsub function. 9c6595514 splitted source lines exceeding 80 cols. bd8e4a1fe implemented the ngx.re.gsub method. 2be93496f documented the optional "ctx" table argument to ngx.re.match. 53574fba9 added support for the ctx argument to ngx.re.match. b73bb88a9 refactored the code a bit and introduced auxiliary function ngx_http_lua_ngx_re_parse_opts. a713340e9 documented the new ngx.re.sub method. 6be0d9cea now we support function to be passed as the "replace" argument to ngx.re.sub(). 4a497814c added support for anchored match modifer "a" to ngx.re.match, ngx.re.gmatch, and ngx.re.sub. 10609bced implemented ngx.re.sub(subj, regex, repl, opts?) method for PCRE regex subsitution. now a template scripting language is supported in the "repl" argument, for example, "$0: $1". "repl" does not support lua function yet. 14c0f0e0c refactored logging related APIs to a separate C compilation unit. 9d842d0f5 minor code refactoring. d32ab9731 refactored subrequest related APIs to a separate C compilation unit. da18e0b4c refactored code for NDK related APIs to a separate C compilation unit. 2c862bb01 checked in missing files. a35f8213b refactored code for redirect related APIs to a separate C compilation unit. 799bd9dff refactored code for time related APIs to a separate C compilation unit. a6c779c8a refactored code for echo related APIs to a separate C compilation unit. ef08db33c refactored code for headers related APIs to a separate C compilation unit. 791ef6cd2 refactored the ngx.req.get_*_args API to a seperate C compilation unit. e2560a43a refactored the ngx.ctx API to a seperate C compilation unit. bd41801bc refactored the ngx.re API to a seperate C compilation unit. cafd7842f documented the ngx.re.gmatch interface. aa747edf6 fixed a memory bug in ngx.re.gmatch(); also added more tests. 8be276db7 first cut on the ngx.re.gmatch() implementation. the first test case is passing now :) bf52ee08b documented the new ngx.re.match() API; fixed unmatched subpattern capturing (we should return nil instead of "" here); only enable ngx.re.match when PCRE is enabled in the nginx core. 8f021621f checked in the first version of the ngx.re.match() regex API implementation. f4f4b6296 sync'd docs from the nginx wiki page. dca8a24b7 made setting ngx.header.HEADER after sending out response headers throw out a Lua exception to help debugging issues like github issue #49. thanks Bill Donahue (ikhoyo). 24772d3f7 sync'd docs from the nginx wiki. c2f3d0edc fixed special char escaping in internal cross links in README.markdown. d3800ccf2 added internal cross-links to README.markdown. 982c664f5 fixed links in README.markdown. fba615a89 added more hyper-links to docs. ccec92f6c added hyper-links to NginxHttpBlahModule tags. e6f3425f8 massive doc improvements. 94c51becf added two samples tiddlers on openresty.org to the See Also section in the doc. 9ca18712e fixed formatting issues in README.markdown. 89cdf6e7f updated README.markdown. 82cab4e24 updated docs from wiki. 507c10831 now we generate README.markdown from doc/manual.wiki. 3659ede68 more formatting improvements. 1d13a1ca2 try markdown links. d49e3fe40 fixed more formatting issues. fd0ef5bb1 more README formatting fixes. dea32100c even more formatting fixes. 3048d74cd more formatting fixes. 356520354 more formatting fixes in the wiki doc. d88e97af4 udpated docs. 05956d68e updated doc/manual.wiki accordingly. 2871af384 more README tweaks. dce23b6c1 updated manual.wiki. 205506be9 more README love. 7a2ee2e9e massive README updates. 437229005 some cross-link love. 62b0e84d6 checked in doc/manual.wiki. f3a628ab2 updated README.markdown to ease converting to wiki. also checked in doc/manual.wiki. 5d318deaf updated docs to reflect recent changes. c43294e8b now ngx.ctx = {...} assignment is also supported. fc44ddb7b fixed a typo in README found by 万珣新. 4b9345088 documented the ngx.ctx "magic table"; also checked in the tests for ngx.ctx. f26d17a89 fixed a memory leak when setting ngx.ctx and later doing an ngx.exec() internal redirect. cfa5eb772 added lots of ngx_log_debugN invocations; completed the first run of the ngx.ctx implementation (still buggy). 445c7309b minor edits in the tests. 302edda86 added tests for outputing lua tables. 988040915 now ngx.print/ngx.say allow (nested) array-like table arguments. the array elements in them will be sent piece by piece. this will avoid string concatenation for templating engines like ltp. d9f68ec6a updated tests to reflect recent changes; also updated README to require identical values in client_max_body_size and client_body_buffer_size when turning lua_need_request_body on. cf52bc17a renamed ngx.req.get_query_args to ngx.req.get_uri_args; the old ngx.req.get_query_args is now deprecated. 5b2eb9633 documented that lua_need_request_body is required to be turned on for ngx.req.get_post_args(). bd6e57214 documented the ngx.req.get_post_args() method in README. 8de549eab added tests for ngx.req.get_post_args(). f2ad70e1b implemented the ngx.req.get_post_args() method for Lua. c8c75c35e fixed a bug in ngx.req.get_query_args(): args requiring unescaping could corrupt r->args buffer. 0e03a4414 updated docs to reflect recent changes in print() and ngx.log(). 10aea81c8 now we also allow Lua booleans and nils in arguments to ngx.log() and print(). 44182153f documented the ngx.req.get_query_args method. this new interface resolves github issue #15. thanks Bertrand Mansion (golgote). 5f0744c15 now we support multi-value keys in ngx.req.get_query_args(). 2502bdcd0 now we allow boolean and nil values as args to ngx.print/ngx.say; also done the first cut on the ngx.req.get_query_args() API. db34dab6b updated valgrind.suppress according to nginx 1.0.5. 52d265b02 reverted bad commits. e31406fa1 worked-around the "stack overflow" issue while using luarocks.loader and disabling lua_code_cache, as described as github issue #27. thanks Patrick Crosby. f2fbc1f24 worked-around the "stack overflow" issue while using luarocks.loader and disabling lua_code_cache, as described as github issue #27. thanks d40eb065e worked-around the "stack overflow" issue while using luarocks.loader and disabling lua_code_cache, as described as github issue #27. thanks 281f7487f we should have returned NGX_DONE instead of NGX_DECLINED when waiting for more request body at rewrite and access phases. this should fix the "zero size buf" alert while combining lua_need_requesty_body on + access_by_lua/rewrite_by_lua + proxy_pass/fastcgi_pass. thanks 万珣新. 1cf8f4fa6 minor coding style fixes. e06c869a0 fixed the support for macros LUA_DEFAULT_PATH and LUA_DEFAULT_CPATH: we get these custom paths work even when the config directives lua_package_path or lua_package_cpath are not used at all. 65f178f59 documented the ngx.parse_http_time() method. thanks James Hurst. 359281876 polished the implementation of ngx.cookie_time, ngx.http_time, and ngx.parse_http_time a bit: removed request object fetching code because we never use it and also added code to test NGX_ERROR returned by ngx_http_parse_time (we return nil in that case). 2fbc16dba Merge remote-tracking branch 'pintsized/master' into devel 243eb9e5b added support for user C macros LUA_DEFAULT_PATH and LUA_DEFAULT_CPATH. for now we can only define them in ngx_lua's config file because nginx configure's --with-cc-opt option hates values with double quotes in them. sigh. 2d285e983 Added ngx.parse_http_time() dc3fa1cd1 Added ngx.parse_http_time() a2eb4c6b9 Merge branch 'master' of github.com:chaoslawful/lua-nginx-module 0457c06c0 fixed an issue regarding defining global variables in C header files: we should have defined the global ngx_http_lua_exception in a single compilation unit. thanks @姜大炮. 9b65b6714 fixed the date in the Changes file. 96f72bd3d fixed a source line exceeding 80 cols. 8e7d37eb9 checked in the Changes file. 4dffb3cea removed the limitation that we cannot capture subrequests with internal redirects from the doc. 5cd3b677b documented setting nginx special variables $limit_rate/$args, and reading special variables $1, $2, $3, and etc. 31bcaa821 ensure that we can compile when pcre is disabled in the nginx build. 95528f511 Merge branch 'devel' c808ce7c3 Merge branch 'devel2' into devel 7c835bde1 now we support ngx.var[1], ngx.var[2], and etc to refer to the nginx regex capturing variables \$1, \$2, and etc in Lua. this resolved github issue #43. thanks Tobia Conforto for reporting it. a28d67ad0 minor test suite refactoring. 40e8a644f now we use the same value overriding mechanism as ngx_rewrite's set command for ngx.var.VAR = new_value. Assigning values to special variables like $limit_rate and $args should now work; also writing to built-in variables that are not changeable (like $arg_PARAMETER) will result in a 500 error page, as expected, now. thanks Richard Kearsley for reporting it. 3d1ec74e8 fixed the lua_code_cache off warning when the lua_code_cache is explicitly on. thanks Feng Xingguo. 9d4744574 Merge branch 'master' of github.com:chaoslawful/lua-nginx-module 9ff893ff8 applied the patch from cyberty to add ngx.http_time() function to expose the nginx core function ngx_http_time to the Lua land. 8e76765ae applied the patch from Feng Xinguo (@cyberty) to add ngx.http_time() function to expose the nginx core function ngx_http_time to the Lua land. dcdcf87ca confirmed that we work with nginx 1.0.4. ef3605b13 updated the ngx_openresty bundle link to openresty.org. ae7b7b8d1 we should have used off_t consistently. mixing it with size_t can cause Bad Things. this should have fixed github issue #42. f39821aaa fixed a formatter mismatch issue in ngx_http_echo_adjust_subrequest. thanks 王斌. 1fa2e121e added two passing tests for setting content-type response header with a charset. bcb1f2c1c suppressed one more valgrind false-alarm for nginx 1.0.x. c52525b3a now in the subrequest capturing processor, we worked around an issue in ngx_http_static_module that when it issues 301 redirect for directory access w/o a trailing slash, it does not inject r->headers_out.location into the r->headers_out.headers list. thanks moodydeath for reporting it in the discussion of github issue #41. b9a84fc3a fixed a tiny bug in the subrequest + internal redirect fix: we should not override the current ctx completely, as mentioned in github issue #41. 6709d16c0 reindexed the tests. a7c013667 added a test for internal redirects by the "index" directive. c3b03fed2 fixed a bug in ngx.location.capture() and ngx.location.capture_multi() that we could not capture locations with internal redirections in them. thanks moodydeath for reporting it in github issue \#41. 1a58a2931 fixed redundant last chunk issue for ngx.exec() invocation at rewrite and access phases: we should quit the current core_run_phases cycle; this also fixed github issue #40: 2 Subrequest calls when using access_by_lua, ngx.exec and echo_location. 9c8b21969 Merge branch 'exit-fixes' 6c147f4e2 used longer timeout for access/exit.t 0f2c228ff updated the documentation for ngx.exit() in README. 7492a1ea6 fixed ngx.exit(status) where status >= 200 and status < 300 for access_by_lua*: it should quit the whole request altegother and skip all those subsequent phase handlers (if any). 15229c2d6 now exit(status) where status >= 200 and status < 300 will successfully quit the current request altogether if being used in rewrite_by_lua or rewrite_by_lua_file. thanks moodydeath for reporting this issue. 1ab26d015 repeat each test case twice in t/016-resp-header.t. e4e299409 fixed github issue #39: setting differnt headers with common prefix might interfere with each other. thanks moodydeath. 43345dcbe documented that ngx.req.get_headers() and its friends only operate on the current request. it has no effect on the current request's subrequests. thanks moodydeath. e8c9ea9e0 fixed GitHub issue #38: request headers did not forward to subrequests when the "method" or "body" option is explicitly specified by a non-nil value for ngx.location.capture(). thanks Richard Kearsley. 2081f73a5 fixed the link to ngx_openresty. d0026ac6d added pointer to the ngx_openresty bundle in the Installation section. ce83076c7 minor formatting. 0dca6659b minor formatting. 2e5d42024 fixed a bug in output header set; we should always set the header->hash to 1. thanks moodydeath for reporting it. 33f2decc4 confirmed that we work with nginx 1.0.2 as well. 75e67b6bb confirmed that we work with 1.0.1. f337896d4 fixed a spot that triggers the "variable set but not used" warning issued by gcc 4.6.0. 670d12b5e splitted source code lines exceeding 80 cols. 6071175d7 suppressed the false alarms on nginx 1.0.1. 6cfe38e07 minor coding style fixes. 4ffeefec2 fixed test failures due to randomness involved in Lua table's pair order; the test suite is passing completely with LuaJIT2.0 now. 9739fccaa added support for multi-value request headers in ngx.req.get_headers(). 23cad91f0 now we turn the ngx.req.header table into an ngx.req.get_headers() function; we also added ngx.req.set_header(name, value) and ngx.req.clear_header(name). thanks moodydeath. 7bba8bfec renamed the 016-headers.t to 016-header-out.t. 098838e5c minor code refactoring for the headers out stuffs. cfa8109d9 minor coding style fixes. 35b4c8d86 implemented the ngx.req.header table interface for retrieving all the request headers for Lua. thanks moodydeath. c230c16f5 no longer use request_eval and respones_eval sections in the tests because they are deprecated now in Test::Nginx. 08ac36810 marked features that require the ngx_devel_kit (NDK) module. 25ff9e40d Merge branch 'optional-ndk' of github.com:chaoslawful/lua-nginx-module into optional-ndk 28b3882d7 now we make ngx_devel_kit (NDK) optional. thanks Kirill A. Korinskiy. 1f8751d1c now we make ngx_devel_kit (NDK) optional. thanks XXX. babcd9e22 documented that we work with nginx 1.0.0. ff7f76976 updated build10. a367a9e57 removed a duplicate definition of the ngx_str_set macro caught by ctags; also fixed a warning thrown by gcc -O3 on Mac OS X 10.6. 0e0b0fc26 also apply PCRE patch to set_by_lua* directives a49c175e6 add patch to use PCRE related LUA extensions in ngx_lua 580279dd3 add warns about data sharing trick in readme 30170eff2 added a quick note regarding ngx.OK/ngx.DONE/ngx.AGAIN/ngx.ERROR. thanks wendal. ce944e1f6 Merge branch 'master' of github.com:chaoslawful/lua-nginx-module 86d6b00f9 documented one known issue that ngx_lua cannot capture locations with internal redirections (either via error_page or ngx_echo's echo_exec directives or ngx_lua's ngx.exec()). 4ffe58d82 added more complex tests (using memcached) for the ngx.exec() after ngx.location.capture() bug; it is already passing. 271a7e184 now we change the way we process HTTP 1.0 requests by automatically buffering all the user outputs generated by ngx.print()/ngx.say() calls, which is much more natural than the old broken way. bd6509047 fixed a regression in the previous ngx.exec() fix when using nginx 0.7.x and 0.8.x < 0.8.11. 241ba237b fixed the "ngx.exec() after ngx.location.capture() hanging" bug for rewrite_by_lua* and access_by_lua* as well. also added tests for these cases. 2431340d8 fixed the bug regarding use of ngx.exec() after ngx.location.capture(), which led to hang. 8a37e835b replace readlink cmd in order to make build.sh working under OSX d6f7dd560 more README tweaks. 52f027bb0 fixed another typo in README. f49621318 fixed a typo in README. f7b3925bb emphasized that the data sharing is per-worker not per-server. ae8c97c8c added a separate section "Data Sharing within an nginx worker. 7a0570480 fixed a typo. d63963efb documented in details about data sharing and race conditions by means of required Lua user modules. 74ba36fea updated README to reflect the changes that we always add those extra linking options on darwin systems because it is too hard to tell if it is a x86_64 system or not. c7907e031 added a test for the hanging bug regarding ngx.exec() used after ngx.location.capture(). a51a2a7ef Merge branch 'master' of github.com:chaoslawful/lua-nginx-module daad6fcef fixed a typo in the error messages. 6bb9a260c fix luajit linking opt on OSX 5a57432cb add missing module info for unit-test; remove unused code; update ndk dependency 98924adae documented the ngx.is_subrequest attribute and enabled ngx.status and ngx.is_subrequest in set_by_lua* as well. 03b3d311d applied a patch from moodydeath to introduce the "ngx.is_subrequest" attribute. a32193bdc now we encourage use of the client_body_in_single_buffer directive instead of big client_body_buffer_size. ccaf13216 updated the contexts each config directive can be used within. 4d4ba140f now we allow rewrite_by_lua(_file) and access_by_lua(_file) at server and http config levels. 0b08a6e65 updated valgrind.suppress. e42cdc0f4 Merge branch 'master' of github.com:chaoslawful/lua-nginx-module 4781ccc5c set vv->no_cacheable too for ngx.var.foo = xxx. 28aa858eb Merge branch 'master' of github.com:chaoslawful/lua-nginx-module 49788e19e fixed typo in config; added extra linking options needed by LuaJIT in 64bit OSX 1db066e64 emphasized in README that Mac 64-bit users have to edit the "config" file themselves when building with LuaJIT 2.0 (for now). fde4b44e6 updated the Status section of README. 06c71b8cc minor tweaks of README. 48063d36a skip more false-alarms for valgrind when building nginx using -O3. 8bc6ec53b fixed the zero size alert caused by ngx.print("") in Lua. 4a7afc242 now we always allocate r->request_body for subrequests when the method option is specified for ngx.location.capture*. this prevents accidental inheritance of parent request's request body when client_body_buffer_size < client_max_body_size. 44fb57098 fixed indentation. 4de07de5d fixed a typo in README. 699c4abd8 added notes about variable number of subrequests for ngx.location.capture_multi to README. thanks Marcus Clyne. 0b39e1e25 optimized the buffer management process a bit for ngx.location.capture*: one the response body is a single buf chain, do not bother concatening it into a new buffer. 149fea4b4 states that we no longer require openssl in README. 0a6ecfe67 now we no longer explicitly require OpenSSL crypto, we now use ngx_md5.h exclusively, and no NDK_HASH pain any more. 6d4ab5ee1 fixed various minor coding style issues. 92520b0ce mentioned the "cosocket" mechanism in the Future Plan section. 19ad8e7a5 minor test adjust. f408e32f7 now we report an error at config time when rewrite_by_lua* are used with nginx 0.8.42 ~ 0.8.53. a6e80250b minor README tweaks. f0b0540b8 updated the TODO, Known Issues, and Future Plan sections in README. af1ebf104 fixed regressions while building with nginx 0.7.x and also confirmed that rewrite_by_lua* work with nginx 0.7.x. 63901b1fb added notes regarding cases when ngx.location.capture and ngx.location.capture_multi fail to capture subrequests' outputs. 972933203 now we recycle the chain links and associated bufs among subrequests issued by one or more ngx.location.capture_multi() calls within a single (parent) request. 4b9c29c6b we now free unused memory chunks more aggressively to reduce memory usage. 60a88383a added some tests for using ngx.location.capture_multi() at rewrite, access, and content phases at the same time and these tests are all passing :) c8aeedc87 we now cancel the ctx->body field and use the parent request's ctx->bodies instead, thus saving some bytes per request. ca4a24322 now we make ctx->waiting a counter and cancel the ctx->waitings array. 5aee1af16 we now post the parent request ourselves in the post_subrequest callback in some extreme condition that the current (sub)request is not active AND it has some weird postponed requests associated with it. this work-around makes those crazily complicated test cases for ngx.location.capture_multi() pass now. a5819c8a7 no longer set the NGX_HTTP_SUBREQUEST_WAITED flag for subrequests. 71fa89025 minor optimizations: we only pass NULL chains down the output filter chain when we really need (that is, the current request is active *AND* there is postponed outputs in r->postponed). 4265dbdc2 minor optimizations in ngx.location.capture_multi() and also fixed a bug in its request options handling (we did not initialize the options properly for *every* request). 3ad08c9e3 updated the TODO list in README to reflect recent changes :) ce540ead3 documented ngx.location.capture_multi() in README. 0048b1fbc the post subrequest callback may be called multiple times (due to finalizing in-active requests) and those useless left-over calls may cause segfaults while accessing parent requests' ctx struct. now we add checks to post_subrequest to prevent its main logic from running twice or more. b6e2e5517 added more tests for ngx.location.capture_multi: 4 parallel subrequests are confirmed to work ;) ef2dbff1f ngx.location.capture_multi(): now we actively switch the active request to the next (postponed) subrequest if the current request is still waiting for its subrequests. 079cb2aab added tests for ngx.location.capture_multi(). 8b19dd8b1 implemented ngx.location.capture_multi(). 4f8f26dae mentioned bad race conditions while reloading lua modules when the lua code cache is off. 2ed82042e minor config cleanup. 65b587c6e added notes for installation on Ubuntu/Debian/Fedora/RHEL/CentOS. 9303bdaf7 added a failing test that ngx.location.capture() cannot capture subrequests with internal redirects because ngx_http_internal_redirect() clears module ctx structs. 4f3607b93 now we skip those lua5.1 and luajit2.0's builtin packages while clearing package.loaded when lua_code_cache is off. 64c6b3497 when subrequest status is 0, assuming 200. adf6c0099 added a test case to demonstrate how to kill timed out mysql queries and also confirmed that we also work with nginx 0.9.4. 6bf089878 added more test cases for phase postponing. 43513dddf added more docs for the Lua code cache. 7d9e04187 updated README to reflect recent changes regarding the lua code cache control. e1522b1d9 added more test cases. c201c8892 now we also pre-calculate cache keys for lua file paths that do not contain nginx variables. d0de36b0a inlined lua code now calculates the digest key only once at config time, this will save some CPU cycles per request. 68b171b73 now we make use of the new ngx_http_complex_value_t struct and related utility functions provided by the nginx core for nginx variable handling in lua file paths. 8b30373df added more code-cache tests for set_by_lua_file. 7ea8bd5a4 fixed a typo in README. 4dceab188 documented the new "lua_code_cache" directive. 47ef132c0 now we forcibly flush "package.loaded" for each http request when lua_code_cache is off. baaaabcc9 first cut on the "lua_code_cache off" directive. mostly working but reloading lua modules still needs some work. 7b30e2984 now ngx.log and those log level constants are available in the context of set_by_lua and set_by_lua_file. 92d7a4f71 minor test code cleanup. 7db7ae134 fixed a typo in README. b626757ed fixed README's wording a bit. c8f59c7fb Merge branch 'master' of github.com:chaoslawful/lua-nginx-module 284c7f1b5 documented that subrequest issued by ngx.location.capture always inherit all the request headers of the parent request. 18293939a Merge branch 'master' of github.com:chaoslawful/lua-nginx-module ac1b3de7e updated todos d2006cbfd fixed a typo: $LIB_LIB should be $LUA_LIB. thanks Vladislav Manchev. de270bf8e fixed -lcrypto library search under /lib for Solaris. ngx_lua should build out of the box there. 5f6813866 No ONLY in exit.t 0fbf2c848 updated config to check openssl and -W,-E support on the fly. f2541c2d5 minor edits. ee1cb7dd6 added a more complicated sample for access_by_phase. 68069101e checked in auth.t. 96b9bbe63 removed unused debug options 84131c0fd resolved conflictions 45de0f0c0 add tests in subdirs into run_test script a910ced9d fixed test cases for earlier versions of nginx. 1660f5731 updated test requirements 0745d1e93 modified doc to reflect *_file directives' change c689ef514 Merge branch 'master' of github.com:chaoslawful/lua-nginx-module 4ba628259 allow using nginx vars in *_by_lua_file directives 44798330a added missing vim modeline 4d153cbae updated the Installation section. ae257b0c2 added one more (passing) test case from Sirsiwal, Umesh e9502dd23 now we no longer emit anything (even special bufs) after eof. 80bb55a3e updated the year list in the copyright notice. 92381c521 edited my names in README. c62a7a523 removed a --- ONLY flag from the test suite. 57d1f80cf rewritten the HTTP 1.0 handling section in README. we can actually automatically generate a Content-Length header for HTTP 1.0 requests. f2374de19 fixed a typo in README. 69527323a added a section in HTTP 1.0 outputs to README. 17bffb5c2 Merge branch 'master' of github.com:chaoslawful/lua-nginx-module ed48b9303 fixed an issue regarding HTTP 1.0 outputs. face45b54 Merge branch 'master' of github.com:chaoslawful/lua-nginx-module e1da31636 fixed comment mark 44bbe7068 applied a modified version of neilljordan 's patch to add support for multi-value response headers returned from subrquests. 9a7c06c4a fixed a bug in rewrite_by_lua* and access_by_lua* regarding automatic response headers sending. thanks Roman Vasilyev. c2ec0b3ab added a test for auth_request + ngx_access. 077ee1a4d documented that access_by_lua* also supports lua_need_request_body. 417e3a760 added a sample for mixing rewrite_by_lua_file, access_by_lua_file, and content_by_lua_file. d2e6375c8 added more tests for access_by_lua. 3da14bc61 added t/024-access/*.t. 02f32dd21 added more sample configs to Synopsis section. 20e919d61 access_by_lua and access_by_lua_file are passing tests now. 2606b2f2f updated .gitignore. 51971a48f added compatibility notes regarding 0.9.x. 554524258 resolved conflicts b0da782fb added typecasts to suppress clang warnings 0590c96d5 now we return NGX_DONE when ngx_http_read_client_request_body returns NGX_AGAIN in content_by_lua. f5187bff3 specified which context a specific lua nginx API is available, like being available in rewrite_by_lua and content_by_lua. 77a036c5a documented that rewrite_by_lua will NOT work with nginx 0.8.41 ~ 0.8.53. 0d2001b02 massive code layout refactoring. 17d56682c moved the handler functions out of directive.[ch]. 657bea5b2 moved t/024-mixed.t to t/023-rewrite/. 530be0965 checked in more tests for rewrite_by_lua. 2f2b1b666 fixed a bug regarding content handler reading request body. 3a25d1866 documented the current behavior of the "lua_need_request_body" directive. 2b53d0d52 re-implemented the "lua_need_request_body" directive. now it is both working for rewrite_by_lua and content_by_lua. 18df04491 now we postpone rewrite_by_lua to the end of the rewrite phase; also reset ctx in content_by_lua to avoid left-over ctx flags set by rewrite_by_lua to taint our content_by_lua handlers. 65ef4ca5e fixed compatibility issues with nginx 0.7.x but still rewrite_by_lua does not work with 0.7.x. 11050d43b rewite_by_lua tests. f8f272aee sanity.t and subrequest.t for rewrite_by_lua* now passing. 9372747c5 rewrite_by_lua starts passing tests. ac647f3e8 coding style fixes. 13dbf2ab3 first cut on rewrite_by_lua support, not there yet. d66c01d39 updated ndk upstream location fb58b876e updated ndk dep 3c1b63a4f Merge branch 'master' of github.com:chaoslawful/lua-nginx-module 2d37ba51d now we use the 2-clause bsd license. 52a7f21c3 Add auto-discovery for FreeBSD. bc1c2d63a added notes about using luajit under 64-bit darwin os; updated ndk depedency 113ba8b72 $ngx_found value cannot be accessed before auto/feature, because it carries-over result from the previous feature check. 9ed533cc0 Add autodiscovery support for Debian Lenny. add96fcf0 added more tests for 500 in subrequests. 967557e8d more README tweaks. 18588a560 documented that you can only write to an nginx variable in Lua when you have predefined it outside at config time. also documented an interesting work-around for set_by_lua to return multiple values to multiple nginx variables at the same time. d4e72a9c2 marked those lua interfaces only available in content_by_lua. ae3ae2e7f renamed ngx.utc_time() to ngx.time(), and canceled the old ngx.time() functionality. also renamed ngx.strtime() to ngx.localtime(), and ngx.utc_strtime() to ngx.utctime(). a348f369b removed trailing spaces in README. ec5a8bc61 more README tweaks. 561a72298 fixed an english wording error. 0e0f1e530 fixed ThinkPad spec in the Performance section. 93186ff6e minor README fixes. 055818238 fixed english wording in Known Issues. d7693625b more README tweaks. 70bba9064 more README tweaks. a7b79f070 states that subrequests are completely different from HTTP 301/302 redirection and internal redirection. d88aa2b07 more README tweaks. 7415b527e more wording tweaks in README. 1fce2771f minor wording tweaks in README. 46642db58 explains how nginx subrequests work and what it can do. e870cad23 documented the "args" option for ngx.location.capture(). bf7f4f76c implemented the "args" option for ngx.location.capture. 74f541f5b tweaked the docs for ngx.redirect(). 32c3686a1 implemented, tested, and documented the new ngx.redirect(uri, status) method for Lua. d98a14778 documented the share_all_vars option for ngx.location.capture in README. d53fe2831 added a share_all_vars option to ngx.location.capture to resume the old behavior of sharing all variables among parent and sub requests. 06563fa52 now we do not share variables by default. 8eb0d8010 removed ngx.throw_error from the documentation. 82ff13ad1 more README love. 1c1b04550 implemented ngx.utc_strtime() and ngx.time(). cbc0ca96c further renamed ngx.utc_now to ngx.utc_time, and ngx.now to ngx.strnow per Piotr's suggestion. fa9f606ce renamed ngx.time further to ngx.utc_now. 8a06613c7 documented that ngx.now() returns local time while ngx.time() returns GMT time. ad2b41ff6 renamed ngx.get_today() to ngx.today(), ngx.get_now() to ngx.now(), and ngx.get_now_ts() to ngx.time(). 9ecb1f073 minor formatting fixes in README. f901a4064 documented ngx.get_today(), ngx.get_now(), ngx.get_now_ts(), and ngx.cookie_time(t) in README. 77d344d3d implemented ngx.cookie_time(timestamp) as per Igor A. Valcov. a4b8f98d3 added a link to chaoslawful's wiki page for ngx_lua. 76507f452 minor README tweaks. b41e7dd96 removed non-GET method support in ngx.location.capture from the TODO list in README. 1b87f64b0 documented the option arg for ngx.location.capture as well as the "method" and "body" options. 0e312b7b1 checked in the tests for POST/PUT/DELETE/HEAD subreqeusts issued by ngx.location.capture. 8e9a88981 implemented the method and body options for ngx.location.capture. 539cad599 fixed a typo in README. 6bf961e22 updated TODO section. e4a02b350 now we escape all those chars escaped by FF3.5's encodeURIComponent in ngx.escape_uri. 9ea82353a style fixes. 102608046 fixed line number. 2cf4b0aa1 documented that nil args are allowed in print and ngx.log but not ngx.print nor ngx.say. 583f00758 no longer allow nil arguments in ngx.print nor ngx.say. 69dabae30 added ngx.location.capture_multi to the TODO list. ee83dbf78 now we allow use of nil in print(), ngx.log(), ngx.print(), and ngx.say(). cb4e03208 more README tweaks. fd45a1619 more README tweaks. cca047e55 more README tweaks. 1223e88e7 minor README tweaks. a88715d9f renamed "NginX" to "Nginx" in README because the former looks weird to me ;) 1de920040 improved wording a bit in README. 4383444b2 more comments on ngx.send_headers() in README. e5bd77e86 documented ngx.encode_base64 and ngx.decode_base64. b54c7568a renamed ngx.base64_encode and ngx.base64_decode to ngx.encode_base64 and ngx.decode_base64 for consistency. 47d397dd0 documented res.header where res is the retval of ngx.location.capture. 45220955a implemented the response headers support in ngx.location.capture. 435a0a3a5 documented that keys in ngx.header.HEADER will be matched case-insentively. 7af330114 added a failing test for $arg_v not defiled side-effect bug. 783dc72dd minor optimizations by specifying pre-allocated item count in lua_createtable. e126d5664 improved the error message: "content_by_lua prematurely ended" => "content_by_lua aborted". 04876fcf0 now we make print in Lua use the ngx.NOTICE log level. 3c998b20d renamed ngx.throw_error to ngx.exit. the former is now deprecated. 78667e424 updated .gitignore. ed3cda136 now we make "print" use the debug log level and the "lua print: " prefix. 1a2962311 confirmed that we work with 0.8.53. 96f6d4c60 now we cached the ndk.set_var.DIRECTIVE lua closure to eliminate config directive lookup at every call. c76f755bb eliminate allocating "hv" on the heap to reduce runtime cost. 19c9415ad now we also escape "=" in ngx.escape_uri. 9fd1a9704 now we allow ngx.throw_error(0). 0927d6439 fixed typos in error messages. 855d522e1 avoid using newlines in closure factory wrapper code to ensure the line numbers in error messages are correct. 7c8c131af documented ndk.set_var.DIRECTIVE interface. 16d947f3a checked in 018-ndk.t for ndk.set_var.xxx testing. cdc883239 added static for clarity. abd0f29d2 minor style fixes in 006-escape.t. 25284b10c now we also escape / in ngx.escape_uri. d92839afb implemented ndk.set_var.DIRECTIVE such that we can invoke directives of other nginx C modules directly from within Lua :D d954160e3 implemented and documented and tested ngx.exec to named locations. 6fc54f5ef fixed a typo in README. f33ac9d2e now we allow overriding multi-value headers. 10deafbf7 documented the multi-value header setting feature. a1a32738b implemented multi-value header setting. ce82ec28c states that ngx.exec never returns. 3811a28b8 documented how to clear a response header. 226a207df documented ngx.header.xxx, ngx.exec, and ngx.status in README. acdc74c14 implemented ngx.exec for Lua. 53abbc08d removed C++ style line comments. 0fa54cef4 more style fixes. 0eebb17ba coding style fixes. e6712e797 repeat_each(2) in 016-headers.t. da9fa90a7 checked in the test file 016-headers.t f5bac10fc implemented the ngx.header.foo API for Lua to set/add/clear response headers. cea93b2f5 implemented 'ngx.status = xxx' and 'my_var = ngx.status' on the Lua land, which is just mapped to nginx core's r->headers_out.status 7dccc5a33 Merge branch 'master' of github.com:chaoslawful/lua-nginx-module b04fff9f8 nginx core's ngx.escape_uri does not escape the plus sign (+), we now use our patched version of this function. ff30f4436 merged marcus' modification; updated ndk depedency c6837de02 Update ndk_md5_hash() to work with updated NDK 7aff45f2a force enabling NGX_OPENSSL_MD5 to solve weird complation issues. f75abbaf8 turned off ddebug. 238c17c22 renamed 011-bugs.t to 014-bugs.t 5d0f7a8e8 tweaked kindy's patch for base64/md5_bin/get_today etc a bit. and pfree aggressively to prevent leaking 3348b1534 added: ngx.now() ngx.now_ts() ~ timestamp ngx.md5_bin(s) ngx.base64_encode(s) ngx.base64_decode(s) 0a6728d78 Merge branch 'master' of github.com:chaoslawful/lua-nginx-module fadcc9f8b checked in t/011-bugs.t. ed8abcc51 updated config; updated dependency 4eb5d5e43 Merge branch 'master' of github.com:chaoslawful/lua-nginx-module 18297b16c fixed ngx.quote_sql_str which should put the surrounding quotes. 5a77f7ce9 removed unused readme file e3f677a14 removed skip tag for ngx_http_auth_request tests 387f4d5b2 modified build script; modified installation section of readme 712f1d15b complement the directive documents dc9797ecc removed finished job: read request body 2b134cda5 added lua_need_request_body directive to force reading request body; modified tests prefix 253a647db fixed log level signess mismatch 71c41e926 fix readme typo 20c22c2f8 fix readme fmt 1baf7b647 fix readme fmt 6073e0ea2 removed todo file, move all contents into readme 6621e4806 modified todo fmt; add issues in readme 7e808f71b fix readme fmt 5cc5897fd fix readme fmt 96e6f4020 fix readme fmt 488d871c5 fix readme fmt 288ef90b0 fix readme fmt 8e93880bc modified readme fmt d6d01dd89 format readme c78ba3d7f added markdown format readme cea679320 added new feature intro to README 403167a27 added notes to todo list 75b3362d5 * allow default path expanding in path/cpath and added tests * added revim script to automatically insert vim modeline to sources * added retab script to reexpand tabs for given files * format sources and tests 9f206095f remove ngx.log() from todo list bd5c0f471 * added ngx.log() api and prime unit-tests * restored missing vim filetype in unit-tests 1b18a2188 updated todo list eeea4fca2 Revert "xx" cee9eb63a xx eb1c7ea8d reindexed tests fd819a18b updated dependency e09ee9fd2 added ngx.get_today support 15327bb00 resolved conflict between the branches ngx_md5 and share_var. 208a5468e added tests of using ngx.md5 in set_by_lua b2ad6af08 Merge branch 'share_var' 900e35104 Merge branch 'master' of github.com:chaoslawful/lua-nginx-module 5a563ab77 Flush data from memcached during tests initialization. 604e01e32 flush testing memcached before tests begins d8bbb0d7f added testing dependency modules order notes in README 198184925 added a test of share variables in main request bfdd68b57 see nil in ngx.md5 as a null string eadf67ed5 removed explicitly testing dependencies, note them in README instead 1311727d7 added impl of ngx.log to todo list; updated dependencies 9c1b5d5b1 Remove missed skip_nginx block. eb2381c90 Don't hide the fact that this test doesn't work with nginx-0.8.42+. e1eabdcfe added a test of sharing variables 0568303bd added a test of sharing variables 361bc3acd Merge branch 'master' of github.com:chaoslawful/lua-nginx-module 93ce856ea Disable DDEBUG and lower the number of repeats for content tests. 4c34ec535 turned off ddebug :P f796a1aea Merge branch 'master' of github.com:chaoslawful/lua-nginx-module 112f755d9 Fix missed lua_cpath. d3525580d fixed a bug about null string in ngx.quote_sql_str 3ad40f2cf updated dependecies 2eda39777 Merge branch 'master' of github.com:chaoslawful/lua-nginx-module 52746dbfc added lua cmod path in CentOS to tests b559b6c84 added ngx.md5 support 321d63ab2 share variables in subrequest 670f1057b added more tests. 2ae707c62 Merge branch 'master' of github.com:chaoslawful/lua-nginx-module d6497f1d2 Make it work with the build farm. c156cbd31 tags to spaces. 6075d86b1 Merge branch 'master' of github.com:chaoslawful/lua-nginx-module 1f9868185 Revert "some tabs to spaces." c149e8668 Revert "share variables in subrequest" a0ca0193f Revert "added ngx.md5 support" 5042c6e62 Revert "fixed unitialized pad and ngx_md5 return value type issues." 65e364339 fixed unitialized pad and ngx_md5 return value type issues. 88f35b179 Merge branch 'master' of github.com:chaoslawful/lua-nginx-module f28dbe39e some tabs to spaces. 3d071fa82 added ngx.md5 ... de24252a2 Merge branch 'master' of github.com:chaoslawful/lua-nginx-module 611c8568d added ngx.md5 support dbb071344 added reported issues 5e8cf3d5d share variables in subrequest afa444855 added test of using symbol $ in inline lua 82a2d6f7c updated dependencies 30df65d82 Merge branch 'master' of github.com:chaoslawful/lua-nginx-module 048c3682d committed my merge. ad506f9df checked in more tests. a18285ba8 added ngx.quote_sql_str 324cff234 added todo lists c00573fbf fixed several problems in tests 189e56da5 * updated depdencies * added vm panic protection for content_by_lua directives * skipped not-accurate-enough test 9fea98919 enable that bug for ngx_lua. 202d948d7 updated dependencies 9566fd751 make the lua wev handler check r->done and ctx->cleanup. 547786f1c Merge branch 'master' of github.com:chaoslawful/lua-nginx-module 00b94607f mentioned that our test suite requires th engx_auth_request module. 7832a117b resynced external dependencies b9459f1cc documented how to build this module with LuaJIT 2.0 w/o patching config. d934c912f added support for LUAJIT_LIB and LUAJIT_INC env in config. also croak when it fail to find lua/luajit when LUA_LIB or LUAJIT_LIB is set. 4d057e486 fixed more bad links due to github escaping. ffb1f4326 fixed a link due to github escaping. d353933d0 tweaked README more. df79322ab tweaked README a bit more. 26d9dc4cd claims that we are already production ready :) 9f45d4da2 splitted lines that are too long :) 5e4dc3157 added a performance section to README. c26249505 splitted long lines. a2f5cbe21 documented the Nginx Lua API that we have already supported. eb9d381a6 documented the lua_package_path and lua_package_cpath directives. 891dffa8f more ddebug info... 52d2f6cd9 fixed compatibility with nginx 0.8.36 and 0.7.66+. a146d3082 added support for lua_package_path and lua_package_cpath directives as per Piotr Sikora's suggestion. 2540acd81 fixed a compilation error in luaL_error invocations. 5b94570cc use "return luaL_error(...)" instead of "return NGX_ERROR" in lua c functions. 16627e894 implemented ngx.escape_uri and ngx.unescape_uri in both set_by_lua* and content_by_lua*. 62e9a5460 even more ngx.HTTP_XXX constants. 514befedb more ngx.HTTP_XXX constants. c09313d9e minor coding style fixes. fac21194a splitted a long long line of code. 64dd62de2 fixed an memory issue in ngx.var.foo assignment: we should copy out the pointer returned by lua_tolstring. b69e7b5e9 croak when setting non-existent nginx variables in Lua. 5ad33b74b added tests for setting nginx variables from within content_by_lua Lua code. bba0946a7 direct assignment to nginx variables from within Lua code as in "ngx.var.some_var = 32" now works :D 9abf8f208 added support for reading nginx variables directly from within set_by_lua by means of ngx.var.foo. 70467b68a turned off ddebug. a97c330a1 confirmed that we work with nginx 0.8.45. 41261ce76 emphasized that default_type is used to control the MIME-type of the response. 497f2b757 Merge branch 'master' of github.com:chaoslawful/lua-nginx-module ea4c8b6ac tab to spaces in cache.c 2bdd9051a updated echo-nginx-module dependency 494856411 update test-nginx and ngx_devel_kit dependency 967f7dab9 repeat more times in the test suite. 6d4830396 refactored the ngx.var.xxx implementation and added a (passing) test case for content_by_lua + ngx_auth_request ef259e7ce implemented ngx.throw_error interface. 4af58bae1 more tests for require. 5cf560bc6 restored valgrind.suppress file. 993590daf better error diagnostics. 8f764bf53 more tweaks. 1d33e8946 more tweaks. 5a50cfd9a indentation fixes. fc2bba529 tab to spaces for directive.c c6701d161 backported the fix for internal redirect from ngx_echo. fef2069b7 fixed the digest calculation regression for lua loadbuffer. 98fd900d4 refactored the ngx.location.capture implementation a bit. ac2520ba4 now we rename ngx.echo to ngx.print and also introduced ngx.say that append a newline automatically like Perl 6's say 9ecff4791 refactored the ngx.echo function implementation. bbc5e44c9 massive code refactoring and cleanup. bb3e73b1b include ngx_md5.h instead of explicit openssl/md5.h. eed7de1e8 added more comments to the samples in README. 9198f867c added more samples to README. bd4d6d51a added myself to the author list :) 87209af71 fixed typo nginx version macro... ebcfcf4e1 fixed nginx version typo 221221dff * lift lua-nginx-module to the top of config modules * added conditional compilation for building under 0.7.x branch 624f83d78 updated README to claim that we require at least Lua 5.1. b363ddf08 avoid using ndk whenever possible because prototype is missing on *BSD. 84bdafdc7 fixed a memory issue in ngx.echo: we should copy the lua string bytes. 0093e9e58 updated .gitignore. e953ab595 checked in util/ngx-links to trim ngx_http_blah_blah_ prefix via symlinks. b17746e54 renamed _by.[ch] to by.[ch]. 8e09749fc added more tests 5a3078070 BIG DAY! ngx.location.capture passed the 1st test! ec489c72e tab to spaces and also checks the case when ctx is failed to allocate. 02e15406c make request handling coroutines fully separated c92a1a3ec added closure factory loading methods a58172a27 added nginx var modification hook skeleton 777c2d881 updated test-nginx dependency b0820ec2f added one more test case to 2-content.t. 41a3c3e7c fixed the merge conflicts. d39f331ff added more test cases. 741b3cca0 added -E linker options to export lua symbols correctly, for external module usage 6e2513a8a removed unused variables 595e4e142 move all dependency modules into deps/ directory ed0ab1881 added new test-nginx position 9c554bf5d changed test-nginx position dfac35bc8 modified todos 452335df0 * fixed keep-alive hanging bug when using HTTP/1.0 protocol * added more documents about content_by_lua dd9cf532e Merge branch 'master' of github.com:chaoslawful/lua-nginx-module 61a1cbdfd add some comments e5d22ad73 fixed errors in unit-tests 12181757a make ngx.flush() working 7d5753bf5 implemented basic content handler functions: * override print() to output error log * ngx.var[] table to fetch nginx variables * ngx.echo() to output in-memory contents 68cea2ca1 Merge branch 'master' of github.com:chaoslawful/lua-nginx-module 4102502ee reconstructed nginx request passing method for set_by_lua directives f422e7525 tab to spaces in t/1-set.t. 2fbde3c9a Merge branch 'master' of github.com:chaoslawful/lua-nginx-module a6a1f9e83 declared that we are compatible with the latest nginx 0.8.40 and 0.7.66. 844bf3326 Merge branch 'master' of github.com:chaoslawful/lua-nginx-module 8fde5c1b6 removed old unit-tests db5e0e123 recovered run_test util and added missing source files 2de7148a0 updated submodule test-nginx repository revision f86b58725 various fixes. 0ef14aaf3 now we print the detailed error messages to error.log when lua_load fails. 9b3bdee1c added more files to ignore. 4f9535212 Merge branch 'master' of github.com:chaoslawful/lua-nginx-module 99e2b1418 improved util/build.sh using wget. cc7659699 * modified code format, added vim modeline * extract lua env init code into individual functions * added some unit-tests for content_by_lua directives b9d2655d2 Merge branch 'master' of github.com:chaoslawful/lua-nginx-module 94d56e379 added more tests d4b754a8b added basic tests and reindex script 97dd3cdea restored nginx tarball fetching command 3a5c8c08d added .gitignore file 766ade8a1 changed submodule name 9dbc8e8a8 changed test directory name deac6c109 changed test-nginx to submodule points to external repo c6f98fb08 changed lua state storage position; added skeleton content_by_lua* entries 38b202cc7 added unistd.h before including md5.h c990a63b7 fixes the feature test code. 9aba7a3c4 added -lm to ngx_feature_libs. 023579763 fixes the feature test code. 292ab8ab2 added support for env LUA_LIB and LUA_INC in config. 3154636c9 now we use openssl/md5.h 5e7c84bb8 removed done ones; added new ones a5b477357 added .gitignore file 315f20b6b implemented code cache and primitive vm persistence fc236d105 added todo 82619f35b added inline variable check to Lua script/file path; turn to standard Lua+Coco patch; modified log formatter char 539d5fe6a modified comment f07f1fb83 added NGX_HTTP_LUA_ELLIPSIS macro to control if args are passing to script as default arguments (accessed through ellipsis operator ...) 66d737464 modifed readme 601633b09 modified readme contents 23d495b8a * split logic into multiple files and changed config file accordingly * added readme 81f809028 prim working version d6a0d6c6a removed unused ddebug.h 924004558 init commit REVERT: |
||
Théophile Diot
|
e1c67363e5
|
Merge commit 'c7f7669a8cbbcf7f7ce0fc2a294bd7e316522236' into dev | ||
Théophile Diot
|
c7f7669a8c |
Squashed 'src/deps/src/headers-more-nginx-module/' changes from 576cb8197..bea1be3bb
bea1be3bb doc: Fix typo. (#97) d502e4199 bugfix: nginx crash when accessing uninitialized pointer. 91eb0db9e bugfix: update handling of multiple headers changed in nginx 1.23.0. e536bc595 bugfix: fixed build error with nginx >= 1.23.0 00be83f1d doc: update the description of nginx compatibility. (#131) a4a068660 travis-ci: upgrade dist of travis-ci to ubuntu bionic. (#124) f85af9649 travis-ci: bumped the NGINX core to 1.19.9, remove clang compiler mode from travis to save credits. (#121) d6d7ebab3 travis-ci: bumped the NGINX core to 1.19.3. (#114) af8160e01 doc: we now work with nginx 1.17.x (up to 1.17.8 at least). 743a4bb1a travis-ci: bumped the NGINX core to 1.17.8. 552e216a0 travis-ci: switched to OpenResty's fork of LuaJIT. 7255ae95d travis-ci: bumped the NGINX core to 1.17.4. 380e994d3 doc: updated the nginx compatibility list. ab40f3446 travis: bumped the nginx core version to 1.17.1. d3a920ad3 travis: clone the lua-resty-core and lua-resty-lrucache repositories. 085fbbc28 travis: bumped the nginx core version to 1.15.8. f1fadb9e2 tests: t/input-cookie.t: fixed a failing test case with our newest version of ngx_http_lua's LuaJIT alert log. a9f7c7e86 tests: added a passing test for overriding Cache-Control header created by proxy module. 55fbdaba9 doc: bumped version to 0.33. f389f1178 tests: added new valgrind false positives in the latest nginx core. 79ac9547b tests: valgrind.suppress: removed too aggressive suppressions in nginx mem pools and luajit lj_str_new. a799a97ba tests: minor tweaks in valgrind.suppress. d63cf91ed tests: removed extra file-trailing newlines. 4512b82a8 feature: add wildcard match support for more_clear_input_headers. 7b0762aba doc: adjusted the doc for the use of wildcards in header names. thanks Dejiang Zhu for the report. 809668963 doc: updated copyright notice. 732874a0f travis-ci: several improvements and tweaks. 491df7f8d doc: fixed more_clear_input_headers usage examples. 5aa76052d doc: bumped version to 0.32. 04916fbc4 tests: skipped the newly added test case that cannot run in check leak test mode. 30fb25901 bugfix: more_set_input_headers: skips setting multi-value headers for bad requests to avoid segfaults. 84241e444 doc: bumped version to 0.31. 2054d9261 doc: typo fixes. 72c81c922 skipped check leak mode for two test cases using malformed requests. fbab58696 doc: claims that we work with 1.10.x since it is essentially the same as 1.9.x. 4fccc2a19 bugfix: fixed a typo in an error message. 0a5bad907 bugfix: when the nginx core does not properly initialize r->headers_in.headers (due to 400 bad requests and etc), more_set_input_headers might lead to crashes. thanks Marcin Teodorczyk for the report. 7fc33974d doc: fixed the release year. 4cb061b57 travis-ci: use "prove -r t" to run the test suite and test against nginx 1.10.0 instead of 1.8.1. cf016595f various coding style fixes. 4612cb62d Merge branch 'master' of github.com:openresty/headers-more-nginx-module 63b8039d7 doc: release 0.30 and compatibility with nginx cores as far as 1.9.15. b120f866e Merge pull request #52 from chipitsine/master 182d12a19 fixed "exit 0" on failed build 981a6914a feature: initial travis-ci support. f5559ec57 doc: documented the dynamic module support in this module. cabd03a86 doc: typo fix. 2f93b9a31 feature: now this module can be compiled as a dynamic module with ./configure --add-dynamic-module=PATH in NGINX 1.9.11+. thanks Sjir Bagmeijer for the original patch in #44. cc19196c7 minor test tweaks. e77178fd2 config: some refactoring. 443753c53 doc: ngx_openresty -> OpenResty. f14b3667c doc: stated that we are compatible with nginx cores as far as 1.9.7. 88f797a5c bumped version to 0.29. e8822662b bugfix: changing the built-in header X-Forwarded-For via more_set_input_headers or more_clear_input_headersmight not take effect in some parts of the nginx core (like $proxy_add_x_forwarded_for). bbaa39fd9 added a .gitattributes file to correct GitHub's language tag. 51dcf0901 doc: bumped version to 0.28. 473fc9d8e bugfix: fixed errors and warnings with C compilers without variadic macro support. a744defdf removed the useless code snippet enabled by the unused NGX_HTTP_HEADERS macro. it also triggered a compilation error. thanks Vadim A. Misbakh-Soloviov for the report in #39. c8b4b0a95 updated docs to reflect recent changes. 5031112c0 tests: fixed the test plan in input.t. 42d8019f0 bugfix: setting (builtin) request headers Upgrade, Accept, Accept-Language, Depth, Destination, Overwrite, and Date might not take effect in standard nginx modules like ngx_http_proxy, ngx_http_headers, and ngx_http_dav. bc48417d8 bugfix: when the response header Content-Type contains params like "; charset=utf-8", the -t MIME-List options did not work as expected at all. thanks Joseph Bartels for the report in #38. 4648e827e doc: we no longer sync from the nginx wiki site. d0e1a7408 util/build.sh: removed $LUAJIT_LIB and /usr/local/lib from the RPATH list. f6a745a16 bugfix: clearing input headers If-Unmodified-Since, If-Match, and If-None-Match did not clear the builtin "shortcut" fields in ngx_http_headers_in_t which might confuse other nginx modules like ngx_http_not_modified_filter_module. The first header gets "shortcuts" fields since nginx 0.9.2 while the latter two since nginx 1.3.3. 4b20caa63 tests: disabled the test cases exercising multiple http {} blocks since this undocumented feature has been disabled since nginx 1.9.3. ccaede889 doc: bumped version to 0.26. fdf4eabef minor coding style fixes. d20bf26a8 fixed compilation failures with nginx 1.7.11+ configured with --with-threads. a7f81f20b updated doc to reflect recent changes. 02fd3778a style: fixed the coding style of labels. b4f9e524a optimize: removed the unused C function ngx_http_headers_more_rm_header. thanks Markus Linnala for the catch in #28. 2a33f3d01 doc: made it clear that more_set_headers always override existing headers with the same name. 95d8178b0 suppressed a valgrind false positive in libdl. 0c6e05d31 updated docs to reflect recent changes. 61af6c9ee doc: documented the limitation that we cannot remove the "Connection" response header with this module. thanks Michael Orlando for bringing this up in #22. 6e9dd00bb added the missing bit in commit 40414ca1. thanks Edwin Cleton for the report. 6d4d619b3 minor coding style fix. 40414ca1f fixed a warning from the Microsoft C compiler. thanks Edwin Cleton for the report. 4b718e786 various coding style fixes. 7a6fd1136 doc: bumped version to 0.24 and claims that we work with nginx 1.4.4. fe2a70ea5 updated valgrind.suppress for i386. 540c6770f bugfix: more_set_input_headers did not completely override the existing request header with multiple values. thanks Aviram Cohen for the report. bb9271843 doc: minor markdown formatting tweaks. b66e2ef1b removed the plain text README file. ad3d8d622 bumped version to 0.23. 35f8faf54 doc: added syntax highlighting to the code samples. 9c4b6ee1d minor coding style fixes. 1caf5cc41 bugfix: removing request headers might lead to memory corruptions. 566cebf00 minor coding style fixes. 6f06b3720 doc: markdown: added a "table of contents" seciton and lots of "Back to TOC" links. 5f1425508 docs: eliminated links to the nginx wiki wherever possible. 211760978 bugfix: more_set_input_headers might overwrite the value of the $host variable with bad values. 5a70b6b46 bugfix: more_set_headers and more_clear_headers might now work when multiple http {} blocks were used in nginx.conf. 3bc9f941b bugfix: eliminated use of C global variables during configuration phase. 035a5f3d3 updated docs to reflect recent changes. 6d19a3980 fixed the test plan in sanity.t. 31d0e78b7 bumped version to 0.22. 3392914d2 added a (passing) test for setting response headers for HTTP 0.9 requests. 625c550aa updated .gitignore a bit. 147c2737b bugfix: segfaults would happen in more_set_input_headers and more_clear_input_headers when processing HTTP 0.9 requests. thanks Bin Wang for the report in #14. 26f96fb41 bugfix: we did not properly initialize the location response header field in commit b21333e2d. this is a further fix for issue #7. 00ee3cfcf massive coding style fixes. b21333e2d bugfix: segfault might happen when using more_set_headers or more_clear_headers in the case that the nginx core initiated a 301 redirect. this issue was caused by an optimization in the nginx core where ngx_http_core_find_config_phase, for example, does not fully initialize the "Location" response header after creating the header. thanks Brian Akins for the original report in #7 and Vladimir Protasov for the insight in chaoslawful/lua-nginx-module#260. ec05b8981 updated docs to reflect recent changes. be5ea9a6d bugfix: segmentation fault might happen in nginx 1.4.x when using more_set_input_headers on the Cookie request headers because recent versions of nginx no longer always initialize r->headers_in.cookies. 0df17d017 bumped version to 0.20. 376b7bc23 massive coding style fixes in ngx_http_headers_more_headers_in.c. e9f060d50 added test cases for the recent fixes in the Cookie request header handling. 2da1aaa9f fixed places where we should return NGX_ERROR instead of NGX_HTTP_INTERNAL_SERVER_ERROR; also fixed a clang warning. a45243e2f bugfix: modifying the Cookie request headers via more_set_input_headers/more_clear_input_headers did not update the Nginx internal data structure, r->headers_in.cookies, at the same time, which might cause issues when reading variables $cookie_COOKIE, for example. e9b817509 bugfix: modifying the Via request header via more_set_input_headers/more_clear_input_headers did not update the special internal field in the Nginx core, "r->headers_in.via", when the ngx_gzip_filter module is enabled. c7feaa395 bugfix: modifying the X-Real-IP request header via more_set_input_headers/more_clear_input_headers did not update the special internal field in the Nginx core, "r->headers_in.x_real_ip", when the ngx_realip module is enabled. 27c2137c6 bugfix: modifying the Connection request header via more_set_input_headers/more_clear_input_headers did not update the special internal flags in the Nginx core, "r->headers_in.connection_type" and "r->headers_in.keep_alive_n". 95ed9ce74 bugfix: modifying the User-Agent request header via more_set_input_headers/more_clear_input_headers did not update those special internal flags in the Nginx core, like "r->headers_in.msie6" and "r->headers_in.opera". 22ed8a414 updated docs to reflect recent changes. 9ba50727f updated tests to reflect recent changes in ngx_echo regarding the $echo_client_request_headers variable (commit agentzh/echo-nginx-module@2adcf59ec5. 27bcbd290 updated docs to reflect recent changes. 5f9684bbd updated .gitignore a bit. d658a2f90 bugfix: more_clear_input_headers would result in memory invalid reads when removing the 21st request headers. thanks Umesh Sirsiwal for reporting this issue as chaoslawful/lua-nginx-module#176. 0f6132327 removed the sendmsg/ngx_channel valgrind suppression rules. 07702cf8b updated valgrind.suppress for valgrind 3.8.0. bdb1068b6 updated docs to fix my English name. also fixed an issue in the sample code in docs that Transfer-Encoding cannot be cleared. thanks koukou73gr. 658698495 updated docs to reflect recent changes. 3147c8b4f updated .gitignore. 278ba7d20 bugfix: fixed a set-but-not-read warning from the clang static analyzer. 05a862b33 fixed compatibility with nginx 0.7.65. thanks Banping for reporting this. b7c8cfcd3 updated docs to reflect recent changes. 2f5f6601a updated .gitignore. 4ea0a75ad bugfix: more_clear_input_headers did not remove all the instances for the builtin headers or custom headers. bugfix: more_clear_input_headers 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. de80b7972 added a (passing) test for rewrite + more_set_input_headers. 81c8750f1 updated valgrind.suppress for linux i386. cf7e2d587 updated valgrind.suppress for the "hup reload" + valgrind/memcheck testing mode. 33a82ed11 updated valgrind.suppress and .gitignore. aa2ae0f8b updated valgrind.suppress. 4b4bfca98 updated valgrind.suppress. 34e238921 updated valgrind.suppress. 358052601 allow use of the DDEBUG macro from the outside (via the "-D DDEBUG=1" cc opton). de77fd22c updated docs to reflect recent changes. 719ffa26a reindexed the test cases. 5f082e564 Merge branch 'master' of github.com:agentzh/headers-more-nginx-module 006ecab22 bugfix: removing builtin headers in huge request headers with 20+ entries could result in data loss. thanks Chris Dumoulin for the patch in github issue #6. 4f911f68d updated valgrind.suppress for gcc 4.6. 87595f744 optimized the previous commit for padding header value strings with '\0'. 7a719b8ae bugfix: the more_set_input_headers directive might cause invalid memory reads because nginx request header values must be null terminated. thanks Maxim Dounin. ffdda4535 bugfix: more_set_input_headers did not handle the Accept-Encoding request headers properly. thanks 天街夜色. 6cd7ae83c bugfix: Cache-Control header modification might introduce empty value headers when using with the standard ngx_headers module. 55ad2f48e fixed the download page links in docs. be6a17e76 updated docs to state that we work with nginx 1.0.8 and 1.1.5. f7cb29e24 fixed setting Cache-Control response headers. we should properly prepare the r->cache_control array as well. 5de933dc4 we should not set header->hash with ngx_hash_key_lc, not simply to 1. b3c6230a3 use Test::Nginx::Socket instead of Test::Nginx::LWP. ff219e96e fixed a bug when setting a multi-value response header to a single value: the single value will be repeated on each old value. 379085532 confirmed that we work with nginx 1.0.6. 9057b0991 fixed on-demand hander/filter registration trick for HUP. 936a555d6 fixed the "<" and ">" symbols in the markdown doc. 5d484ecc7 updated links in docs. 8b78aec44 renamed the wiki file. 264e523fa added internal cross links to README.markdown. e6c635856 added more hyper-links to README.markdown. 61db52f55 removed unused utilities. 12ccabb15 fixed source lines exceeding 80 cols; checked README.markdown. 78286ca0d confirmed that we work with nginx 1.0.5. 137855d9d release v0.15. 5fac22379 now more_set_headers supports overriding charset in Content-Type. thanks ML. 2c629dee0 fixed an issue in more_clear_headers: we should remove all the instances of the headers specified, not only the first occurrence. thanks 李杨. b1c4273ae back-ported a bugfix from ngx_lua: in output header set, we should always set the header->hash to 1. thanks moodydeath for reporting it. 6a12aa524 confirmed that we work with nginx 1.0.2. ef15b439f minor updates. b27e5d92a minor coding style fixes. 28c62d1d2 added more tests for Accept-Ranges and also fixed a bug when clearing this header. thanks Bo Blangstrup. 7bba2a12b fixed the links to the test suite. 2cbbc15d6 updated the documentation to reflect recent changes. 3641ccfd5 updated .gitignore. fb2d8935d now we postpone the rewrite phase handler only once rather than on every main request previously. this will save some CPU cycles on every request. d732166eb removed the bundled Test::Nginx module from our repos; also raised test/t to the toplevel directory. 19e17f08b fixed two spots where we did not check against null pointers when allocating memory. 592845e90 now we use the 2-clause bsd license. 8bd248f0d updated README from the wiki page. df422fe8a minor tweaks of coding style and .gitignore. c808e71eb renamed the source file names a bit. c5b6141b4 minor coding style tweaks. b4abf2bbf Merge branch 'master' of github.com:agentzh/headers-more-nginx-module 80bcb021b Update Test::Nginx. 442f86638 updated Test::Nginx. 8447e58c5 updated Test::Nginx. 780408eff Use build farm's default server port in tests. 27735dd30 Update Test::Nginx. 9508330b0 releng work for 0.13. 7c6b53e24 fixed a bug in rewrite phase postponing algorithm which may cause eval {...} running after "if". thanks Liseen Wan (xunxin). 7d2db6fa0 enabled the no-pool-nginx patch in our build.sh script for nginx 0.8.41. b14033607 added a test case for adding a header with an empty variable as its value (from Piotr Sikora). 435fee6d3 updated readme to reflect recent changes. 079fa9507 fixed a vim typo... e64e736af we should explicitly clear r->headers_out.content_type_lowcase or it will defeat the gzip filter module. 55cbcab47 added tests for issue 3 ("breaks mime types") on GitHub but cannot reproduce the issue with nginx 0.7.66 nor nginx 0.8.40. b8c872152 updated docs for v0.11. 87e6e7318 fixed the variables-in-Range-header issue reported by Alexander Vetrin. 2afd97b48 use the name "ngx_headers_more" to help SEO. ae532d8d9 updated docs for v0.10. aaf5fce53 removed input headers physically from the r->headers_in.headers list because ngx_proxy does not honor h->hash. 793158dcf removed some debugging code. c68a095c4 now we can completely erase any output headers (both custom and builtin ones). 75b1bfa5d updated README to reflect recent changes. 00c986fde minor style tweaks in the .t files. c47b63790 fixed a memory initialization issue for more_set_input_headers -r, we should always initialize hv.replace even when replace == 0. thanks valgrind++ :D 1b93def22 implemented wildcard header clear 3a67ad830 work around the links in README. 126fce84c updated Test::Nginx. 5cd9a384f documented the -r option. 0b16d5c3f Merge branch 'dobe-r' 0febdfca7 added -r flag to more_set_input_headers 7da6665da updated .gitignore. d0f2bb40e sync'd the test scaffold with Test::Nginx 0.08 on CPAN. fb5ebd568 use ngx_null_string whenever possible. 348da493f sync'd Test::Nginx to 0.07. 4629b7f8e some coding style tweaks. a127664fc added t/bug.t db9913e9c updated docs to reflect recent changes. fc18a5cec fixed the more_clear_headers directive for builtin headers like "Server" and "Last-Modified" by always inserting an empty header when absent. Thanks Sebastiaan Deckers for reporting it. 753e74c66 sync'd Test::Nginx 0.05. 985eeb0b7 updated the test scaffold to Test::Nginx 0.04. dd3ec52a2 updated test scaffold. e427600d2 git ignore reindex. 1792f2d93 releng work for v0.06. f901cecf9 confirmed that we also work in subrequests in t/subrequest.t. 1cc21a715 now the input header handler runs at the *end* of the rewrite phase. b154fdb6b now we free empty headers and types array structs eagerly. 1a2d9c6f9 updated the test scaffold. 05e0fd6c0 sync'd the docs with the wiki page and confirmed that it works with the new nginx 0.8.28 release. 219e6dd05 added a test for rewriting the input Content-Length header using the rewrite module's set directive. d5af63059 sync'd with the wiki page. 628923157 added the wiki page as the main doc. bce15002d added a (passing) test for mixed input/output setters. 8288003cc more docs. 3391d9d71 fixed variables in more_set_input_headers by registering the handler in the "access phase". e2a7a9630 added new directives more_set_input_headers and more_clear_input_headers. 83bf8ed38 now we require at least 0.7.44 due to the use of ngx_http_complex_value_t. ad8b0e5ea releng for v0.03. b93bd9b1f fixed the uninitialized s/t bug in parse_statuses and parse_types. also added a (failing) test for the input header directives. 219d75425 first big refactoring in order to introduce input header support. 91cf5b797 refactored the structs into the header. 993e75b20 more README tweaks. 6023eac18 tested against the latest 0.8.27 and 0.7.64. 1da2c8721 added more docs to README. 8483f9a62 removed explicit clear header handlers. ade7573ba now we support variables in new headers' values. 742097fdc fixed a typo in README. c131b08ed 0.7.21 is the minimum nginx version requirement. 5e86ea379 more docs and more love. 934fe6677 updated README. c6af9971e this module is now usable. 0593d3b42 added tests for the Charset header. 6fdb040be more tests and more fixes. 51c432883 fixed Content-Type. ba695a3c0 fixed various bugs and all tests are passing now. b3b524553 fixed a bug where I carelessly used r->headers_in for r->headers_out. the test is passing now. 229898621 added a simple test which is failing atm :P 5af162eb9 things are complete now but we haven't tested anything yet :P bb0a53ca0 it finally compiles :) af379a735 implemented parsers for the -t and -s options in the config directives. 148554637 added usage to README. 8b0498a95 added README. 8876cec82 initial checkin REVERT: |
||
Théophile Diot
|
8da04e022c
|
Merge commit '6ed1ec58b1acdc1acb00e840df89311812ee8422' into dev | ||
Théophile Diot
|
6ed1ec58b1 |
Squashed 'src/deps/src/luajit/' changes from aa038d259..4182d6bf3
4182d6bf3 Merge branch 'v2.1' into v2.1-agentzh 43d0a1915 Fix last commit. 536cf8a27 Merge branch 'master' into v2.1 644723649 x86/x64: Don't fuse loads across IR_NEWREF. 113a168b7 Improve last commit. 45c88b796 x86/x64: Don't fuse loads across table.clear. 6807e60af Merge branch 'master' into v2.1 d854d00ce x86/x64: Add more red zone checks to assembler backend. 7c9671a04 Merge branch 'master' into v2.1 a4c164043 Add stack check to pcall/xpcall. 69bbbf773 Merge branch 'master' into v2.1 65c849390 Invalidate SCEV entry when returning to lower frame. b94fbfbee Merge branch 'master' into v2.1 433d7e8d8 FFI: Fix pragma push stack limit check and throw on overflow. ce2cd6173 ARM64: Fix disassembly of ldp/stp offsets. 07b3cd3cf Check for upvalue state transition in IR_UREFO. 0afa1676b Merge branch 'master' into v2.1 d133d67c8 x64: Properly fix __call metamethod return dispatch. f2e955dae Windows/x86: _BitScan*64 are only available on 64 bit archs. e826d0c10 Add 'cc' file type for saving bytecode. 4eb47df60 FFI/Windows: Fix type declaration for int64_t and uint64_t. 7269b0213 Merge branch 'master' into v2.1 db944b2b5 FFI: Fix dangling reference to CType in carith_checkarg(). 656ecbcf8 DynASM/ARM64: Support ldp/stp of q registers. d2a5487fd ARM64: Use ADR and ADRP to form constants. 14866a682 ARM64: Fix disassembly of U12 loads. c5b075eb3 ARM64: Unify constant register handling in interpreter. 9cc8bbb7a ARM: Fix register hint for FFI calls with FP results. 1e93951b2 ARM64: Fix register hint for FFI calls with FP results. 007e4dce1 ARM64: Restore fp before sp in C stack unwinders. git-subtree-dir: src/deps/src/luajit git-subtree-split: 4182d6bf37e9f8d1cb5d6e83b1db66de84b95101 |
||
Théophile Diot
|
dab004604d
|
Update LuaJIT to version v2.1-20231117 | ||
Théophile Diot
|
e5e7db36e8
|
Merge pull request #763 from bunkerity/dependabot/github_actions/dev/github/codeql-action-2.22.7
deps/gha: bump github/codeql-action from 2.22.6 to 2.22.7 |
||
Jordan Blasenhauer
|
984a3de5cb | add setup template | ||
Jordan Blasenhauer
|
f36d2d0c93 | Merge branch 'dev' into ui |