...
 
Commits (6)
Changes with nginx 1.16.1 13 Aug 2019
*) Security: when using HTTP/2 a client might cause excessive memory
consumption and CPU usage (CVE-2019-9511, CVE-2019-9513,
CVE-2019-9516).
Changes with nginx 1.16.0 23 Apr 2019
*) 1.16.x stable branch.
......
Изменения в nginx 1.16.1 13.08.2019
*) Безопасность: при использовании HTTP/2 клиент мог вызвать чрезмерное
потребление памяти и ресурсов процессора (CVE-2019-9511,
CVE-2019-9513, CVE-2019-9516).
Изменения в nginx 1.16.0 23.04.2019
*) Стабильная ветка 1.16.x.
......
nginx (1.16.1-1bionic0) bionic; urgency=medium
* Non-maintainer upload.
* New upstream stable release 1.16.1
* http-ndk: Upgrade to 0.3.1
* http-lua: Upgrade to 0.10.15
* nchan: Upgrade to 1.2.6
-- Filip Chabik <hadret@gmail.com> Wed, 21 Aug 2019 11:25:48 +0000
nginx (1.16.0-0bionic0) bionic; urgency=medium
* Non-maintainer upload
* New upstream stable release (1.16.0)
* Test build
* New upstream stable release 1.16.0
-- Filip Chabik <hadret@gmail.com> Fri, 26 Apr 2019 13:11:48 +0000
......
......@@ -5,7 +5,7 @@ Files-Excluded: .gitignore .gitattributes .travis.yml
Module: http-ndk
Homepage: https://github.com/simpl/ngx_devel_kit/
Version: 0.3.0
Version: 0.3.1
Module: http-auth-pam
Homepage: https://github.com/stogh/ngx_http_auth_pam_module
......@@ -18,7 +18,7 @@ Files-Excluded: .gitignore .gitattributes .travis.yml
Module: http-lua
Homepage: https://github.com/openresty/lua-nginx-module
Version: 0.10.14
Version: 0.10.15
Patch:
openssl-1.1.0.patch
discover-luajit-2.1.patch
......@@ -34,7 +34,7 @@ Patch:
Module: nchan
Homepage: https://github.com/slact/nchan
Version: 1.2.5
Version: 1.2.6
Files-Excluded: dev nchan_logo.png NchanSubscriber.js
Module: http-uploadprogress
......
......@@ -63,7 +63,7 @@ Production ready.
Version
=======
This document describes ngx_lua [v0.10.14](https://github.com/openresty/lua-nginx-module/tags) released on February 23rd, 2019.
This document describes ngx_lua [v0.10.15](https://github.com/openresty/lua-nginx-module/tags) released on March 14th, 2019.
Synopsis
========
......@@ -1004,6 +1004,7 @@ See Also
Directives
==========
* [lua_load_resty_core](#lua_load_resty_core)
* [lua_capture_error_log](#lua_capture_error_log)
* [lua_use_default_type](#lua_use_default_type)
* [lua_malloc_trim](#lua_malloc_trim)
......@@ -1079,6 +1080,38 @@ how the result will be used. Below is a diagram showing the order in which direc
[Back to TOC](#table-of-contents)
lua_load_resty_core
-------------------
**syntax:** *lua_load_resty_core on|off*
**default:** *lua_load_resty_core on*
**context:** *http*
Controls whether the `resty.core` module (from
[lua-resty-core](https://github.com/openresty/lua-resty-core)) should be loaded
or not. When enabled, this directive is equivalent to executing the following
when the Lua VM is created:
```lua
require "resty.core"
```
Note that usage of the `resty.core` module is recommended, as its
FFI implementation is both faster, safer, and more complete than the Lua C API
of the ngx_lua module.
It must also be noted that the Lua C API of the ngx_lua module will eventually
be removed, and usage of the FFI-based API (i.e. the `resty.core`
module) will become mandatory. This directive only aims at providing a
temporary backwards-compatibility mode in case of edge-cases.
This directive was first introduced in the `v0.10.15` release.
[Back to TOC](#directives)
lua_capture_error_log
---------------------
**syntax:** *lua_capture_error_log size*
......@@ -6705,7 +6738,7 @@ ngx.shared.DICT.flush_expired
Flushes out the expired items in the dictionary, up to the maximal number specified by the optional `max_count` argument. When the `max_count` argument is given `0` or not given at all, then it means unlimited. Returns the number of items that have actually been flushed.
Unlike the [flush_all](#ngxshareddictflush_all) method, this method actually free up the memory used by the expired items.
Unlike the [flush_all](#ngxshareddictflush_all) method, this method actually frees up the memory used by the expired items.
This feature was first introduced in the `v0.6.3` release.
......
......@@ -12,7 +12,7 @@ Production ready.
= Version =
This document describes ngx_lua [https://github.com/openresty/lua-nginx-module/tags v0.10.14] released on February 23rd, 2019.
This document describes ngx_lua [https://github.com/openresty/lua-nginx-module/tags v0.10.15] released on March 14th, 2019.
= Synopsis =
<geshi lang="nginx">
......@@ -835,6 +835,34 @@ how the result will be used. Below is a diagram showing the order in which direc
![Lua Nginx Modules Directives](https://cloud.githubusercontent.com/assets/2137369/15272097/77d1c09e-1a37-11e6-97ef-d9767035fc3e.png)
== lua_load_resty_core ==
'''syntax:''' ''lua_load_resty_core on|off''
'''default:''' ''lua_load_resty_core on''
'''context:''' ''http''
Controls whether the <code>resty.core</code> module (from
[https://github.com/openresty/lua-resty-core lua-resty-core]) should be loaded
or not. When enabled, this directive is equivalent to executing the following
when the Lua VM is created:
<geshi lang="lua">
require "resty.core"
</geshi>
Note that usage of the <code>resty.core</code> module is recommended, as its
FFI implementation is both faster, safer, and more complete than the Lua C API
of the ngx_lua module.
It must also be noted that the Lua C API of the ngx_lua module will eventually
be removed, and usage of the FFI-based API (i.e. the <code>resty.core</code>
module) will become mandatory. This directive only aims at providing a
temporary backwards-compatibility mode in case of edge-cases.
This directive was first introduced in the <code>v0.10.15</code> release.
== lua_capture_error_log ==
'''syntax:''' ''lua_capture_error_log size''
......@@ -5639,7 +5667,7 @@ See also [[#ngx.shared.DICT.flush_expired|ngx.shared.DICT.flush_expired]] and [[
Flushes out the expired items in the dictionary, up to the maximal number specified by the optional <code>max_count</code> argument. When the <code>max_count</code> argument is given <code>0</code> or not given at all, then it means unlimited. Returns the number of items that have actually been flushed.
Unlike the [[#ngx.shared.DICT.flush_all|flush_all]] method, this method actually free up the memory used by the expired items.
Unlike the [[#ngx.shared.DICT.flush_all|flush_all]] method, this method actually frees up the memory used by the expired items.
This feature was first introduced in the <code>v0.6.3</code> release.
......
......@@ -19,7 +19,7 @@
/* Public API for other Nginx modules */
#define ngx_http_lua_version 10014
#define ngx_http_lua_version 10015
typedef struct {
......
......@@ -182,6 +182,8 @@ struct ngx_http_lua_main_conf_s {
ngx_cycle_t *cycle;
ngx_pool_t *pool;
ngx_flag_t load_resty_core;
ngx_int_t max_pending_timers;
ngx_int_t pending_timers;
......@@ -479,7 +481,7 @@ typedef struct {
typedef struct ngx_http_lua_ctx_s {
/* for lua_coce_cache off: */
/* for lua_code_cache off: */
ngx_http_lua_vm_state_t *vm_state;
ngx_http_request_t *request;
......
......@@ -77,6 +77,13 @@ static ngx_conf_bitmask_t ngx_http_lua_ssl_protocols[] = {
static ngx_command_t ngx_http_lua_cmds[] = {
{ ngx_string("lua_load_resty_core"),
NGX_HTTP_MAIN_CONF|NGX_CONF_FLAG,
ngx_conf_set_flag_slot,
NGX_HTTP_MAIN_CONF_OFFSET,
offsetof(ngx_http_lua_main_conf_t, load_resty_core),
NULL },
{ ngx_string("lua_max_running_timers"),
NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1,
ngx_conf_set_num_slot,
......@@ -877,6 +884,7 @@ ngx_http_lua_create_main_conf(ngx_conf_t *cf)
*/
lmcf->pool = cf->pool;
lmcf->load_resty_core = NGX_CONF_UNSET;
lmcf->max_pending_timers = NGX_CONF_UNSET;
lmcf->max_running_timers = NGX_CONF_UNSET;
#if (NGX_PCRE)
......@@ -910,6 +918,10 @@ ngx_http_lua_init_main_conf(ngx_conf_t *cf, void *conf)
{
ngx_http_lua_main_conf_t *lmcf = conf;
if (lmcf->load_resty_core == NGX_CONF_UNSET) {
lmcf->load_resty_core = 1;
}
#if (NGX_PCRE)
if (lmcf->regex_cache_max_entries == NGX_CONF_UNSET) {
lmcf->regex_cache_max_entries = 1024;
......
......@@ -77,8 +77,7 @@ static void ngx_http_lua_pipe_resume_write_handler(ngx_event_t *ev);
static void ngx_http_lua_pipe_resume_wait_handler(ngx_event_t *ev);
static ngx_int_t ngx_http_lua_pipe_resume(ngx_http_request_t *r);
static void ngx_http_lua_pipe_dummy_event_handler(ngx_event_t *ev);
static void ngx_http_lua_pipe_cleanup_helper(
ngx_http_lua_co_ctx_t *wait_co_ctx);
static void ngx_http_lua_pipe_clear_event(ngx_event_t *ev);
static void ngx_http_lua_pipe_proc_read_stdout_cleanup(void *data);
static void ngx_http_lua_pipe_proc_read_stderr_cleanup(void *data);
static void ngx_http_lua_pipe_proc_write_cleanup(void *data);
......@@ -703,8 +702,8 @@ ngx_http_lua_ffi_pipe_spawn(ngx_http_lua_ffi_pipe_proc_t *proc,
"pipe fd");
}
errlog_fd = ngx_cycle->log->file->fd;
if (errlog_fd == STDERR_FILENO) {
if (ngx_cycle->log->file && ngx_cycle->log->file->fd == STDERR_FILENO) {
errlog_fd = ngx_cycle->log->file->fd;
temp_errlog_fd = dup(errlog_fd);
if (temp_errlog_fd == -1) {
......@@ -2217,19 +2216,7 @@ ngx_http_lua_pipe_resume_helper(ngx_event_t *ev,
ev->timedout = 0;
}
if (ev->timer_set) {
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, ev->log, 0,
"lua pipe del timer for ev:%p", ev);
ngx_del_timer(ev);
}
if (ev->posted) {
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, ev->log, 0,
"lua pipe del posted event for ev:%p", ev);
ngx_delete_posted_event(ev);
}
ev->handler = ngx_http_lua_pipe_dummy_event_handler;
ngx_http_lua_pipe_clear_event(ev);
r = ngx_http_lua_get_req(wait_co_ctx->co);
c = r->connection;
......@@ -2377,15 +2364,21 @@ ngx_http_lua_pipe_dummy_event_handler(ngx_event_t *ev)
static void
ngx_http_lua_pipe_cleanup_helper(ngx_http_lua_co_ctx_t *wait_co_ctx)
ngx_http_lua_pipe_clear_event(ngx_event_t *ev)
{
if (wait_co_ctx->sleep.timer_set) {
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, wait_co_ctx->sleep.log, 0,
"lua pipe del timer for ev:%p", &wait_co_ctx->sleep);
ngx_del_timer(&wait_co_ctx->sleep);
ev->handler = ngx_http_lua_pipe_dummy_event_handler;
if (ev->timer_set) {
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, ev->log, 0,
"lua pipe del timer for ev:%p", ev);
ngx_del_timer(ev);
}
wait_co_ctx->cleanup = NULL;
if (ev->posted) {
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, ev->log, 0,
"lua pipe del posted event for ev:%p", ev);
ngx_delete_posted_event(ev);
}
}
......@@ -2404,10 +2397,10 @@ ngx_http_lua_pipe_proc_read_stdout_cleanup(void *data)
c = proc->pipe->stdout_ctx->c;
if (c) {
rev = c->read;
rev->handler = ngx_http_lua_pipe_dummy_event_handler;
ngx_http_lua_pipe_clear_event(rev);
}
ngx_http_lua_pipe_cleanup_helper(wait_co_ctx);
wait_co_ctx->cleanup = NULL;
}
......@@ -2426,10 +2419,10 @@ ngx_http_lua_pipe_proc_read_stderr_cleanup(void *data)
c = proc->pipe->stderr_ctx->c;
if (c) {
rev = c->read;
rev->handler = ngx_http_lua_pipe_dummy_event_handler;
ngx_http_lua_pipe_clear_event(rev);
}
ngx_http_lua_pipe_cleanup_helper(wait_co_ctx);
wait_co_ctx->cleanup = NULL;
}
......@@ -2448,10 +2441,10 @@ ngx_http_lua_pipe_proc_write_cleanup(void *data)
c = proc->pipe->stdin_ctx->c;
if (c) {
wev = c->write;
wev->handler = ngx_http_lua_pipe_dummy_event_handler;
ngx_http_lua_pipe_clear_event(wev);
}
ngx_http_lua_pipe_cleanup_helper(wait_co_ctx);
wait_co_ctx->cleanup = NULL;
}
......@@ -2471,14 +2464,9 @@ ngx_http_lua_pipe_proc_wait_cleanup(void *data)
pipe_node = (ngx_http_lua_pipe_node_t *) &node->color;
pipe_node->wait_co_ctx = NULL;
if (wait_co_ctx->sleep.posted) {
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, ngx_cycle->log, 0,
"lua pipe del posted event for ev:%p",
&wait_co_ctx->sleep);
ngx_delete_posted_event(&wait_co_ctx->sleep);
}
ngx_http_lua_pipe_clear_event(&wait_co_ctx->sleep);
ngx_http_lua_pipe_cleanup_helper(wait_co_ctx);
wait_co_ctx->cleanup = NULL;
}
......
......@@ -762,6 +762,20 @@ ngx_http_lua_ffi_escape_uri(const u_char *src, size_t len, u_char *dst)
ngx_http_lua_escape_uri(dst, (u_char *) src, len, NGX_ESCAPE_URI_COMPONENT);
}
void
ngx_http_lua_ffi_str_replace_char(u_char *buf, size_t len, const u_char find,
const u_char replace)
{
while (len) {
if (*buf == find) {
*buf = replace;
}
buf++;
len--;
}
}
#endif
/* vi:set ft=c ts=4 sw=4 et fdm=marker: */
......@@ -147,6 +147,13 @@ static int ngx_http_lua_get_raw_phase_context(lua_State *L);
#define LUA_PATH_SEP ";"
#endif
#if !defined(LUA_DEFAULT_PATH) && (NGX_DEBUG)
#define LUA_DEFAULT_PATH "../lua-resty-core/lib/?.lua;" \
"../lua-resty-lrucache/lib/?.lua"
#endif
#define AUX_MARK "\1"
......@@ -3813,6 +3820,7 @@ ngx_http_lua_init_vm(lua_State *parent_vm, ngx_cycle_t *cycle,
ngx_pool_t *pool, ngx_http_lua_main_conf_t *lmcf, ngx_log_t *log,
ngx_pool_cleanup_t **pcln)
{
int rc;
lua_State *L;
ngx_uint_t i;
ngx_pool_cleanup_t *cln;
......@@ -3880,6 +3888,21 @@ ngx_http_lua_init_vm(lua_State *parent_vm, ngx_cycle_t *cycle,
lua_pop(L, 2);
}
if (lmcf->load_resty_core) {
lua_getglobal(L, "require");
lua_pushstring(L, "resty.core");
rc = lua_pcall(L, 1, 1, 0);
if (rc != 0) {
ngx_log_error(NGX_LOG_ERR, log, 0,
"lua_load_resty_core failed to load the resty.core "
"module from https://github.com/openresty/lua-resty"
"-core; ensure you are using an OpenResty release "
"from https://openresty.org/en/download.html "
"(rc: %i, reason: %s)", rc, lua_tostring(L, -1));
}
}
return L;
}
......
......@@ -10,11 +10,6 @@ $ENV{TEST_NGINX_MEMCACHED_PORT} ||= 11211;
$ENV{TEST_NGINX_MYSQL_PORT} ||= 3306;
our $http_config = <<'_EOC_';
upstream database {
drizzle_server 127.0.0.1:$TEST_NGINX_MYSQL_PORT protocol=mysql
dbname=ngx_test user=ngx_test password=ngx_test;
}
lua_package_path "../lua-resty-mysql/lib/?.lua;;";
_EOC_
......
......@@ -24,7 +24,7 @@ __DATA__
=== TEST 1: sanity
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location /main {
echo_location /load;
......
......@@ -242,4 +242,4 @@ GET /t
--- response_body_like: 500 Internal Server Error
--- error_code: 500
--- error_log eval
qr/bad argument \#2 to 'encode_base64' \(boolean expected, got number\)|\[error\] .*? boolean argument only/
qr/bad argument \#2 to 'encode_base64' \(boolean expected, got number\)|\[error\] .*? bad no_padding: boolean expected, got number/
......@@ -43,7 +43,7 @@ __DATA__
=== TEST 1: sanity
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location /load {
content_by_lua '
......@@ -69,7 +69,7 @@ end
=== TEST 2: sanity
--- http_config
lua_package_path '/home/agentz/rpm/BUILD/lua-yajl-1.1/build/?.so;/home/lz/luax/?.so;./?.so';
lua_package_cpath '/home/agentz/rpm/BUILD/lua-yajl-1.1/build/?.so;/home/lz/luax/?.so;./?.so';
--- config
location = '/report/listBidwordPrices4lzExtra.htm' {
content_by_lua '
......@@ -847,7 +847,7 @@ ok
=== TEST 37: resolving names with a trailing dot
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location /t {
resolver $TEST_NGINX_RESOLVER ipv6=off;
......@@ -865,7 +865,7 @@ GET /t
=== TEST 38: resolving names with a trailing dot
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';
server {
listen 12354;
......@@ -892,7 +892,7 @@ args: foo=1&bar=2
=== TEST 39: lua_code_cache off + setkeepalive
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
lua_code_cache off;
location = /t {
......
......@@ -325,7 +325,7 @@ found the end of the stream
=== TEST 4: attempt to use the req socket across request boundary
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location /t {
rewrite_by_lua '
......@@ -376,7 +376,7 @@ hello world
=== TEST 5: receive until on request_body - receiveuntil(1) on the last byte of the body
See https://groups.google.com/group/openresty/browse_thread/thread/43cf01da3c681aba for details
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location /t {
rewrite_by_lua '
......@@ -440,7 +440,7 @@ done
=== TEST 6: pipelined POST requests
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location /t {
rewrite_by_lua '
......
......@@ -27,7 +27,7 @@ __DATA__
=== TEST 1: sanity
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location /t {
set $port $TEST_NGINX_MEMCACHED_PORT;
......@@ -104,7 +104,7 @@ lua tcp socket get keepalive peer: using connection
=== TEST 2: free up the whole connection pool if no active connections
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location /t {
set $port $TEST_NGINX_MEMCACHED_PORT;
......@@ -177,7 +177,7 @@ received: OK
=== TEST 3: upstream sockets close prematurely
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
server_tokens off;
keepalive_timeout 100ms;
......@@ -254,7 +254,7 @@ done
=== TEST 4: http keepalive
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
server_tokens off;
location /t {
......@@ -815,7 +815,7 @@ lua tcp socket keepalive timeout: unlimited
=== TEST 11: sanity (uds)
--- http_config eval
"
lua_package_path '$::HtmlDir/?.lua;./?.lua';
lua_package_path '$::HtmlDir/?.lua;./?.lua;;';
server {
listen unix:$::HtmlDir/nginx.sock;
default_type 'text/plain';
......@@ -953,7 +953,7 @@ lua tcp socket get keepalive peer: using connection
=== TEST 13: github issue #110: ngx.exit with HTTP_NOT_FOUND causes worker process to exit
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
error_page 404 /404.html;
location /t {
......
......@@ -250,11 +250,11 @@ attempt to send data on a closed socket:
}
--- request
GET /t
--- response_body
--- response_body_like
connected: 1
request sent: 56
first line received: HTTP/1.1 200 OK
second line received: Server: openresty
first line received: HTTP\/1\.1 200 OK
second line received: (?:Date|Server): .*?
--- no_error_log
[error]
......@@ -1082,7 +1082,7 @@ close: 1 nil
=== TEST 19: cannot survive across request boundary (send)
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
server_tokens off;
location /t {
......@@ -1143,7 +1143,7 @@ received: OK|failed to send request: closed)\$"
=== TEST 20: cannot survive across request boundary (receive)
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
server_tokens off;
location /t {
......@@ -1214,7 +1214,7 @@ received: OK|failed to receive a line: closed \[nil\])$/
=== TEST 21: cannot survive across request boundary (close)
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
server_tokens off;
location /t {
......@@ -1285,7 +1285,7 @@ received: OK|failed to close: closed)$/
=== TEST 22: cannot survive across request boundary (connect)
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
server_tokens off;
location /t {
......@@ -2041,7 +2041,7 @@ close: 1 nil
=== TEST 33: bad request tries to connect
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
server_tokens off;
location = /main {
......@@ -2097,7 +2097,7 @@ qr/runtime error: rewrite_by_lua\(nginx\.conf:\d+\):7: bad request/
=== TEST 34: bad request tries to receive
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
server_tokens off;
location = /main {
......@@ -2156,7 +2156,7 @@ qr/runtime error: rewrite_by_lua\(nginx\.conf:\d+\):14: bad request/
=== TEST 35: bad request tries to send
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
server_tokens off;
location = /main {
......@@ -2215,7 +2215,7 @@ qr/runtime error: rewrite_by_lua\(nginx\.conf:\d+\):14: bad request/
=== TEST 36: bad request tries to close
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
server_tokens off;
location = /main {
......@@ -2274,7 +2274,7 @@ qr/runtime error: rewrite_by_lua\(nginx\.conf:\d+\):14: bad request/
=== TEST 37: bad request tries to set keepalive
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
server_tokens off;
location = /main {
......@@ -2333,7 +2333,7 @@ qr/runtime error: rewrite_by_lua\(nginx\.conf:\d+\):14: bad request/
=== TEST 38: bad request tries to receiveuntil
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
server_tokens off;
location = /main {
......
......@@ -298,7 +298,7 @@ exiting the user thread
=== TEST 5: exit in user thread (entry thread is still pending on the DNS resolver for ngx.socket.tcp)
--- config
location /lua {
resolver agentzh.org;
resolver 127.0.0.2:12345;
resolver_timeout 12s;
rewrite_by_lua '
local function f()
......@@ -403,7 +403,7 @@ after
=== TEST 6: exit in user thread (entry thread is still pending on the DNS resolver for ngx.socket.udp)
--- config
location /lua {
resolver agentzh.org;
resolver 127.0.0.2:12345;
#resolver 127.0.0.1;
resolver_timeout 12s;
rewrite_by_lua '
......
......@@ -298,7 +298,7 @@ exiting the user thread
=== TEST 5: exit in user thread (entry thread is still pending on the DNS resolver for ngx.socket.tcp)
--- config
location /lua {
resolver agentzh.org;
resolver 127.0.0.2:12345;
resolver_timeout 12s;
access_by_lua '
local function f()
......@@ -394,7 +394,7 @@ after
=== TEST 6: exit in user thread (entry thread is still pending on the DNS resolver for ngx.socket.udp)
--- config
location /lua {
resolver agentzh.org;
resolver 127.0.0.2:12345;
resolver_timeout 12s;
access_by_lua '
local function f()
......
......@@ -193,7 +193,7 @@ qr/\[alert\] \S+ lua_code_cache is off; this will hurt performance/
=== TEST 6: code cache explicitly off (affects require) + content_by_lua
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location /lua {
lua_code_cache off;
......@@ -231,7 +231,7 @@ qr/\[alert\] \S+ lua_code_cache is off; this will hurt performance/
=== TEST 7: code cache explicitly off (affects require) + content_by_lua_file
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location /lua {
lua_code_cache off;
......@@ -269,7 +269,7 @@ qr/\[alert\] \S+ lua_code_cache is off; this will hurt performance/
=== TEST 8: code cache explicitly off (affects require) + set_by_lua_file
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location /lua {
lua_code_cache off;
......@@ -308,7 +308,7 @@ qr/\[alert\] \S+ lua_code_cache is off; this will hurt performance/
=== TEST 9: code cache explicitly on (affects require) + set_by_lua_file
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location /lua {
lua_code_cache on;
......@@ -468,7 +468,7 @@ qr/\[alert\] \S+ lua_code_cache is off; this will hurt performance/
=== TEST 14: no clear builtin lib "string"
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
lua_code_cache off;
location /lua {
......@@ -504,7 +504,7 @@ qr/\[alert\] \S+ lua_code_cache is off; this will hurt performance/
=== TEST 15: do not skip luarocks
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';
lua_code_cache off;"
--- config
location /main {
......@@ -554,7 +554,7 @@ qr/\[alert\] \S+ lua_code_cache is off; this will hurt performance/
=== TEST 16: do not skip luarocks*
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';
lua_code_cache off;"
--- config
location /main {
......@@ -604,7 +604,7 @@ qr/\[alert\] \S+ lua_code_cache is off; this will hurt performance/
=== TEST 17: clear _G table
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
lua_code_cache off;
location /t {
......@@ -1050,7 +1050,7 @@ qr/\[alert\] \S+ lua_code_cache is off; this will hurt performance/,
=== TEST 29: cosocket connection pool timeout (after Lua VM destroys)
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
lua_code_cache off;
location = /t {
......@@ -1118,7 +1118,7 @@ qr/\blua tcp socket keepalive: free connection pool [0-9A-F]+ for "127.0.0.1:/,
=== TEST 30: cosocket connection pool timeout (before Lua VM destroys)
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
lua_code_cache off;
location = /t {
......
......@@ -482,9 +482,9 @@ end
GET /main
--- response_body
matched
sr failed: 500
--- error_log
attempt to use ngx.re.gmatch iterator in a request that did not create it
matched
--- no_error_log
[error]
......
......@@ -245,11 +245,11 @@ attempt to send data on a closed socket:
--- request
GET /t
--- response_body
--- response_body_like
connected: 1
request sent: 56
first line received: HTTP/1.1 200 OK
second line received: Server: openresty
first line received: HTTP\/1\.1 200 OK
second line received: (?:Date|Server): .*?
--- no_error_log
[error]
--- timeout: 10
......@@ -1057,7 +1057,7 @@ close: 1 nil
=== TEST 19: cannot survive across request boundary (send)
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
server_tokens off;
location /t {
......@@ -1116,7 +1116,7 @@ received: OK|failed to send request: closed)\$"
=== TEST 20: cannot survive across request boundary (receive)
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
server_tokens off;
location /t {
......@@ -1191,7 +1191,7 @@ received: OK|failed to receive a line: closed \[nil\])$/
=== TEST 21: cannot survive across request boundary (close)
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
server_tokens off;
location /t {
......@@ -1260,7 +1260,7 @@ received: OK|failed to close: closed)$/
=== TEST 22: cannot survive across request boundary (connect)
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
server_tokens off;
location /t {
......@@ -2672,7 +2672,7 @@ lua clean up the timer for pending ngx.sleep
=== TEST 44: bad request tries to connect
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
server_tokens off;
location = /main {
......@@ -2726,7 +2726,7 @@ qr/runtime error: content_by_lua\(nginx\.conf:\d+\):7: bad request/
=== TEST 45: bad request tries to receive
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
server_tokens off;
location = /main {
......@@ -2783,7 +2783,7 @@ qr/runtime error: content_by_lua\(nginx\.conf:\d+\):14: bad request/
=== TEST 46: bad request tries to send
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
server_tokens off;
location = /main {
......@@ -2840,7 +2840,7 @@ qr/runtime error: content_by_lua\(nginx\.conf:\d+\):14: bad request/
=== TEST 47: bad request tries to close
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
server_tokens off;
location = /main {
......@@ -2897,7 +2897,7 @@ qr/runtime error: content_by_lua\(nginx\.conf:\d+\):14: bad request/
=== TEST 48: bad request tries to set keepalive
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
server_tokens off;
location = /main {
......@@ -2954,7 +2954,7 @@ qr/runtime error: content_by_lua\(nginx\.conf:\d+\):14: bad request/
=== TEST 49: bad request tries to receiveuntil
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
server_tokens off;
location = /main {
......
......@@ -283,7 +283,7 @@ n = 5
--- request
GET /test
--- response_body
n = 18
n = 22
--- no_error_log
[error]
......
......@@ -22,7 +22,7 @@ __DATA__
=== TEST 1: ngx.exit(400) should abort print
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location = /memc_query {
internal;
......@@ -68,7 +68,7 @@ GET /test?a
=== TEST 2: ngx.exit(400) should abort ngx.log
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location = /memc_query {
internal;
......@@ -116,7 +116,7 @@ GET /test?a
=== TEST 3: ngx.exit(400) should abort ngx.location.capture
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location = /memc_query {
internal;
......@@ -161,7 +161,7 @@ the "$memc_key" variable is not set
=== TEST 4: ngx.exit(400) should abort ngx.location.capture_multi
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location = /memc_query {
internal;
......@@ -206,7 +206,7 @@ the "$memc_key" variable is not set
=== TEST 5: ngx.exit(400) should abort ngx.redirect
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location = /test {
content_by_lua '
......@@ -233,7 +233,7 @@ lua redirect to "/blah" with code 302
=== TEST 6: ngx.exit(400) should abort ngx.exit
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location = /test {
content_by_lua '
......@@ -260,7 +260,7 @@ lua exit with code 503
=== TEST 7: ngx.exit(400) should abort ngx.exec
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location = /test {
content_by_lua '
......@@ -287,7 +287,7 @@ lua exec "/blah?"
=== TEST 8: ngx.exit(400) should abort ngx.send_headers
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location = /test {
content_by_lua '
......@@ -314,7 +314,7 @@ lua send headers
=== TEST 9: ngx.exit(400) should abort ngx.print
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location = /test {
content_by_lua '
......@@ -341,7 +341,7 @@ lua print response
=== TEST 10: ngx.exit(400) should abort ngx.say
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location = /test {
content_by_lua '
......@@ -368,7 +368,7 @@ lua say response
=== TEST 11: ngx.exit(400) should abort ngx.flush
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location = /test {
content_by_lua '
......@@ -395,7 +395,7 @@ lua flush asynchronously
=== TEST 12: ngx.exit(400) should abort ngx.eof
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location = /test {
content_by_lua '
......@@ -422,7 +422,7 @@ lua send eof
=== TEST 13: ngx.exit(400) should abort ngx.re.match
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location = /test {
content_by_lua '
......@@ -449,7 +449,7 @@ lua compiling match regex "a" with options "jo"
=== TEST 14: ngx.exit(400) should abort ngx.re.gmatch
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location = /test {
content_by_lua '
......@@ -476,7 +476,7 @@ lua compiling gmatch regex "a" with options "jo"
=== TEST 15: ngx.exit(400) should abort ngx.re.sub
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location = /test {
content_by_lua '
......@@ -503,7 +503,7 @@ lua compiling sub regex "a" with options "jo"
=== TEST 16: ngx.exit(400) should abort ngx.re.gsub
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location = /test {
content_by_lua '
......@@ -530,7 +530,7 @@ lua compiling gsub regex "a" with options "jo"
=== TEST 17: ngx.exit(400) should abort ngx.shared.DICT (set)
--- http_config eval
"lua_shared_dict dogs 1m; lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_shared_dict dogs 1m; lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location = /test {
content_by_lua '
......@@ -560,7 +560,7 @@ foo = 56
=== TEST 18: ngx.exit(400) should abort ngx.shared.DICT (replace)
--- http_config eval
"lua_shared_dict dogs 1m; lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_shared_dict dogs 1m; lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location = /test {
content_by_lua '
......@@ -590,7 +590,7 @@ foo = 56
=== TEST 19: ngx.exit(400) should abort ngx.shared.DICT (incr)
--- http_config eval
"lua_shared_dict dogs 1m; lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_shared_dict dogs 1m; lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location = /test {
content_by_lua '
......@@ -620,7 +620,7 @@ foo = 88
=== TEST 20: ngx.exit(400) should abort ngx.shared.DICT (get)
--- http_config eval
"lua_shared_dict dogs 1m; lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_shared_dict dogs 1m; lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location = /test {
content_by_lua '
......@@ -649,7 +649,7 @@ fetching key "foo" in shared dict "dogs"
=== TEST 21: ngx.exit(400) should skip os.execute
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location = /test {
content_by_lua '
......@@ -679,7 +679,7 @@ GET /test
=== TEST 22: ngx.exit(400) should break pcall and skip os.execute
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location = /test {
content_by_lua '
......@@ -709,7 +709,7 @@ fetching key "foo" in shared dict "dogs"
=== TEST 23: ngx.exit(400) should break pcall and skip os.execute (all in user module)
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location = /test {
content_by_lua '
......@@ -739,7 +739,7 @@ GET /test
=== TEST 24: ngx.redirect() should break pcall and skip os.execute (all in user module)
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location = /test {
content_by_lua '
......@@ -769,7 +769,7 @@ GET /test
=== TEST 25: ngx.redirect() should skip os.execute (all in user module)
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location = /test {
content_by_lua '
......@@ -799,7 +799,7 @@ GET /test
=== TEST 26: ngx.exec() should break pcall and skip os.execute (all in user module)
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location = /test {
content_by_lua '
......@@ -832,7 +832,7 @@ foo
=== TEST 27: ngx.exec() should skip os.execute (all in user module)
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location = /test {
content_by_lua '
......@@ -865,7 +865,7 @@ foo
=== TEST 28: ngx.set_uri(uri, true) should break pcall and skip os.execute (all in user module)
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location = /test {
rewrite_by_lua '
......@@ -921,7 +921,7 @@ hello world
=== TEST 30: ngx.exit(400) should break xpcall and skip os.execute (all in user module)
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location = /test {
content_by_lua '
......@@ -955,7 +955,7 @@ GET /test
=== TEST 31: ngx.exec() should skip os.execute (all in user module)
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location = /test {
content_by_lua '
......@@ -988,7 +988,7 @@ foo
=== TEST 32: ngx.exec() should break pcall and skip os.execute (all in user module)
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location = /test {
content_by_lua '
......
......@@ -22,7 +22,7 @@ __DATA__
=== TEST 1: pcall works
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location = /test {
content_by_lua '
......@@ -58,7 +58,7 @@ $/s
=== TEST 2: xpcall works
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location = /test {
content_by_lua '
......
......@@ -320,7 +320,7 @@ found the end of the stream
=== TEST 4: attempt to use the req socket across request boundary
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location /t {
content_by_lua '
......@@ -369,7 +369,7 @@ hello world
=== TEST 5: receive until on request_body - receiveuntil(1) on the last byte of the body
See https://groups.google.com/group/openresty/browse_thread/thread/43cf01da3c681aba for details
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location /t {
content_by_lua '
......@@ -431,7 +431,7 @@ done
=== TEST 6: pipelined POST requests
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location /t {
content_by_lua '
......
......@@ -30,7 +30,7 @@ __DATA__
=== TEST 1: sanity
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location /t {
set $port $TEST_NGINX_MEMCACHED_PORT;
......@@ -98,7 +98,7 @@ lua tcp socket keepalive create connection pool for key "127.0.0.1:$ENV{TEST_NGI
=== TEST 2: free up the whole connection pool if no active connections
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location /t {
set $port $TEST_NGINX_MEMCACHED_PORT;
......@@ -169,7 +169,7 @@ received: OK
=== TEST 3: upstream sockets close prematurely
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
server_tokens off;
keepalive_timeout 100ms;
......@@ -244,7 +244,7 @@ done
=== TEST 4: http keepalive
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
server_tokens off;
location /t {
......@@ -808,7 +808,7 @@ qr/lua tcp socket connection pool size: 30\b/]
=== TEST 12: sanity (uds)
--- http_config eval
"
lua_package_path '$::HtmlDir/?.lua;./?.lua';
lua_package_path '$::HtmlDir/?.lua;./?.lua;;';
server {
listen unix:$::HtmlDir/nginx.sock;
default_type 'text/plain';
......@@ -936,7 +936,7 @@ lua tcp socket get keepalive peer: using connection
=== TEST 14: github issue #110: ngx.exit with HTTP_NOT_FOUND causes worker process to exit
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
error_page 404 /404.html;
location /t {
......@@ -995,7 +995,7 @@ Not found, dear...
=== TEST 15: custom pools (different pool for the same host:port) - tcp
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location /t {
set $port $TEST_NGINX_MEMCACHED_PORT;
......@@ -1043,7 +1043,7 @@ lua tcp socket keepalive create connection pool for key "B"
=== TEST 16: custom pools (same pool for different host:port) - tcp
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location /t {
set $port $TEST_NGINX_MEMCACHED_PORT;
......@@ -1091,7 +1091,7 @@ lua tcp socket get keepalive peer: using connection
=== TEST 17: custom pools (different pool for the same host:port) - unix
--- http_config eval
"
lua_package_path '$::HtmlDir/?.lua;./?.lua';
lua_package_path '$::HtmlDir/?.lua;./?.lua;;';
server {
listen unix:$::HtmlDir/nginx.sock;
default_type 'text/plain';
......@@ -1151,7 +1151,7 @@ lua tcp socket keepalive create connection pool for key "B"
=== TEST 18: custom pools (same pool for the same path) - unix
--- http_config eval
"
lua_package_path '$::HtmlDir/?.lua;./?.lua';
lua_package_path '$::HtmlDir/?.lua;./?.lua;;';
server {
listen unix:$::HtmlDir/nginx.sock;
default_type 'text/plain';
......@@ -1205,7 +1205,7 @@ lua tcp socket get keepalive peer: using connection
=== TEST 19: numeric pool option value
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location /t {
set $port $TEST_NGINX_MEMCACHED_PORT;
......@@ -1252,7 +1252,7 @@ lua tcp socket get keepalive peer: using connection
=== TEST 20: nil pool option value
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location /t {
set $port $TEST_NGINX_MEMCACHED_PORT;
......@@ -1295,7 +1295,7 @@ connected: 1, reused: 0
=== TEST 21: (bad) table pool option value
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location /t {
set $port $TEST_NGINX_MEMCACHED_PORT;
......@@ -1336,7 +1336,7 @@ bad argument #3 to 'connect' (bad "pool" option type: table)
=== TEST 22: (bad) boolean pool option value
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location /t {
set $port $TEST_NGINX_MEMCACHED_PORT;
......@@ -1394,7 +1394,7 @@ bad argument #3 to 'connect' (bad "pool" option type: boolean)
=== TEST 24: bug in send(): clear the chain writer ctx
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location /t {
set $port $TEST_NGINX_REDIS_PORT;
......
......@@ -824,7 +824,7 @@ probe syscall.socket.return, syscall.connect.return {
=== TEST 15: bad request tries to setpeer
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
server_tokens off;
location = /main {
......@@ -881,7 +881,7 @@ qr/runtime error: content_by_lua\(nginx\.conf:\d+\):14: bad request/
=== TEST 16: bad request tries to send
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
server_tokens off;
location = /main {
......@@ -938,7 +938,7 @@ qr/runtime error: content_by_lua\(nginx\.conf:\d+\):14: bad request/
=== TEST 17: bad request tries to receive
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
server_tokens off;
location = /main {
......@@ -995,7 +995,7 @@ qr/runtime error: content_by_lua\(nginx\.conf:\d+\):14: bad request/
=== TEST 18: bad request tries to close
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
server_tokens off;
location = /main {
......@@ -1052,7 +1052,7 @@ qr/runtime error: content_by_lua\(nginx\.conf:\d+\):14: bad request/
=== TEST 19: bad request tries to receive
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
server_tokens off;
location = /main {
......
......@@ -178,7 +178,7 @@ cc3: 2
local urls = {
"agentzh.org",
"iscribblet.org",
"openresty.com",
"openresty.org"
}
......@@ -204,7 +204,7 @@ cc3: 2
GET /lua
--- response_body
successfully connected to: agentzh.org
successfully connected to: iscribblet.org
successfully connected to: openresty.com
successfully connected to: openresty.org
*** All Done ***
--- no_error_log
......@@ -377,7 +377,7 @@ GET /lua
local urls = {
"agentzh.org",
"iscribblet.org",
"openresty.com",
"openresty.org"
}
......@@ -398,7 +398,7 @@ GET /lua
GET /lua
--- response_body
successfully connected to: agentzh.org
successfully connected to: iscribblet.org
successfully connected to: openresty.com
successfully connected to: openresty.org
*** All Done ***
--- no_error_log
......
......@@ -297,7 +297,7 @@ exiting the user thread
=== TEST 5: exit in user thread (entry thread is still pending on the DNS resolver for ngx.socket.tcp)
--- config
location /lua {
resolver agentzh.org;
resolver 127.0.0.2:12345;
resolver_timeout 12s;
content_by_lua '
local function f()
......@@ -393,7 +393,7 @@ after
=== TEST 6: exit in user thread (entry thread is still pending on the DNS resolver for ngx.socket.udp)
--- config
location /lua {
resolver agentzh.org;
resolver 127.0.0.2:12345;
resolver_timeout 12s;
content_by_lua '
local function f()
......
......@@ -320,7 +320,7 @@ qr/received: Server: \S+/,
=== TEST 6: tcp cosocket in timer handler (keep-alive connections)
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location = /t {
......@@ -596,7 +596,7 @@ qr/\[lua\] log_by_lua\(nginx\.conf:\d+\):\d+: elapsed: 0\.0(?:6[4-9]|7[0-6])/,
=== TEST 10: tcp cosocket in timer handler (keep-alive connections) - log_by_lua
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location = /t {
......@@ -693,7 +693,7 @@ qr/go\(\): connected: 1, reused: \d+/,
=== TEST 11: tcp cosocket in timer handler (keep-alive connections) - header_filter_by_lua
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location = /t {
......@@ -799,7 +799,7 @@ qr/go\(\): connected: 1, reused: \d+/,
=== TEST 12: tcp cosocket in timer handler (keep-alive connections) - body_filter_by_lua
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location = /t {
......@@ -912,7 +912,7 @@ qr/go\(\): connected: 1, reused: \d+/,
=== TEST 13: tcp cosocket in timer handler (keep-alive connections) - set_by_lua
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location = /t {
......
......@@ -229,7 +229,7 @@ qr/received: Server: \S+/,
=== TEST 4: tcp cosocket in timer handler (keep-alive connections)
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location = /t {
......@@ -508,7 +508,7 @@ qr/\[lua\] log_by_lua\(nginx\.conf:\d+\):\d+: elapsed: 0\.0(?:6[4-9]|7[0-9]|8[0-
=== TEST 8: tcp cosocket in timer handler (keep-alive connections) - log_by_lua
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location = /t {
......@@ -606,7 +606,7 @@ qr/go\(\): connected: 1, reused: \d+/,
=== TEST 9: tcp cosocket in timer handler (keep-alive connections) - header_filter_by_lua
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location = /t {
......@@ -713,7 +713,7 @@ qr/go\(\): connected: 1, reused: \d+/,
=== TEST 10: tcp cosocket in timer handler (keep-alive connections) - body_filter_by_lua
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location = /t {
......@@ -827,7 +827,7 @@ qr/go\(\): connected: 1, reused: \d+/,
=== TEST 11: tcp cosocket in timer handler (keep-alive connections) - set_by_lua
--- http_config eval
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
--- config
location = /t {
......
......@@ -11,7 +11,7 @@ repeat_each(2);
plan tests => repeat_each() * (blocks() * 3 + 1);
$ENV{LUA_PATH} = "/foo/bar/baz";
$ENV{LUA_PATH} = "../lua-resty-core/lib/?.lua;../lua-resty-lrucache/lib/?.lua;/foo/bar/baz";
$ENV{LUA_CPATH} = "/baz/bar/foo";
#no_diff();
#no_long_string();
......@@ -36,8 +36,8 @@ env LUA_CPATH;
}
--- request
GET /lua
--- response_body
/foo/bar/baz
--- response_body_like
(?:\.\.\/lua-resty-core\/lib\/\?\.lua;\.\.\/lua-resty-lrucache\/lib\/\?\.lua;){1,2}\/foo\/bar\/baz
/baz/bar/foo
--- no_error_log
......@@ -60,8 +60,8 @@ env LUA_CPATH;
}
--- request
GET /lua
--- response_body
/foo/bar/baz
--- response_body_like
(?:\.\.\/lua-resty-core\/lib\/\?\.lua;\.\.\/lua-resty-lrucache\/lib\/\?\.lua;){1,2}\/foo\/bar\/baz
/baz/bar/foo
--- no_error_log
......
......@@ -521,12 +521,11 @@ warn(): Thu, 01 Jan 1970 01:34:38 GMT
}
--- request
GET /t
--- response_body
timer created
--- response_body_like
connected: 1
request sent: 56
first line received: HTTP/1.1 200 OK
second line received: Server: openresty
first line received: HTTP\/1\.1 200 OK
second line received: (?:Date|Server): .*?
--- no_error_log
[error]
--- timeout: 10
......