@@ -4,7 +4,7 @@ use Test::Nginx::Socket::Lua;
44
55repeat_each(2);
66
7- plan tests => repeat_each() * 187 ;
7+ plan tests => repeat_each() * 190 ;
88
99our $HtmlDir = html_dir;
1010
@@ -3640,3 +3640,53 @@ failed to receive a line: closed []
36403640close: 1 nil
36413641--- error_log
36423642lua http cleanup reuse
3643+
3644+
3645+
3646+ === TEST 60: options_table is nil
3647+ --- config
3648+ location /t {
3649+ set $port $TEST_NGINX_MEMCACHED_PORT;
3650+
3651+ content_by_lua_block {
3652+ local sock = ngx.socket.tcp()
3653+ local port = ngx.var.port
3654+
3655+ local ok, err = sock:connect("127.0.0.1", port, nil)
3656+ if not ok then
3657+ ngx.say("failed to connect: ", err)
3658+ return
3659+ end
3660+
3661+ ngx.say("connected: ", ok)
3662+
3663+ local req = "flush_all\r\n"
3664+
3665+ local bytes, err = sock:send(req)
3666+ if not bytes then
3667+ ngx.say("failed to send request: ", err)
3668+ return
3669+ end
3670+ ngx.say("request sent: ", bytes)
3671+
3672+ local line, err, part = sock:receive()
3673+ if line then
3674+ ngx.say("received: ", line)
3675+
3676+ else
3677+ ngx.say("failed to receive a line: ", err, " [", part, "]")
3678+ end
3679+
3680+ ok, err = sock:close()
3681+ ngx.say("close: ", ok, " ", err)
3682+ }
3683+ }
3684+ --- request
3685+ GET /t
3686+ --- response_body
3687+ connected: 1
3688+ request sent: 11
3689+ received: OK
3690+ close: 1 nil
3691+ --- no_error_log
3692+ [error]
0 commit comments