Add shdict set_when, safe_set_when, and store_when
This pull request adds set_when and safe_set_when methods to ngx.shared.DICT.
It also adds ngx_stream_lua_ffi_shdict_store_when which is used in Add shdict set_when and safe_set_when by hnakamur · Pull Request #268 · openresty/lua-resty-core.
I hereby granted the copyright of the changes in this pull request to the authors of this lua-resty-core project.
Test with the following pull request fails at https://travis-ci.org/hnakamur/stream-lua-nginx-module/builds/569568232
- https://github.com/openresty/lua-nginx-module/pull/1574
- https://github.com/openresty/lua-resty-core/pull/268
https://travis-ci.org/hnakamur/stream-lua-nginx-module/jobs/569568238
# Failed test 'TEST 5: lua_load_resty_core 'on' in stream block and 'off' in http block - response_body - response is expected (repeated req 0, req 0)
# @@ -1,2 +1,2 @@
# resty.core loaded in stream: true
# -resty.core loaded in http: false
# +resty.core loaded in http: true
# '
# at /usr/local/share/perl/5.18.2/Test/Nginx/Socket.pm line 1589.
Tests fails since resty.core is not loaded in http, but I don't know the reason yet.
Could you give some advice to investigate?
Thanks!
Ah I see.
nginx: [warn] lua_load_resty_core is deprecated (the lua-resty-core library is required since ngx_lua v0.10.16)
So resty.core is always loaded, then existing tests in stream-lua-nginx-module should be updated.
Test passes at https://travis-ci.org/hnakamur/stream-lua-nginx-module/builds/570491636
with t/161-load-resty-core.t deleted.