File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed
Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -125,6 +125,9 @@ ngx_http_lua_uthread_wait(lua_State *L)
125125 coctx = ctx -> cur_co_ctx ;
126126
127127 nargs = lua_gettop (L );
128+ if (nargs == 0 ) {
129+ return luaL_error (L , "at least one coroutine should be specified" );
130+ }
128131
129132 for (i = 1 ; i <= nargs ; i ++ ) {
130133 sub_co = lua_tothread (L , i );
Original file line number Diff line number Diff line change @@ -1321,3 +1321,22 @@ $s;
13211321-- - no_error_log
13221322[error]
13231323[alert]
1324+
1325+
1326+
1327+ === TEST 23 : no parameters for ngx. thread. wait
1328+ -- - config
1329+ location / lua {
1330+ content_by_lua_block {
1331+ ngx. thread. wait ()
1332+ ngx. say (" ok" )
1333+ }
1334+ }
1335+ -- - request
1336+ GET / lua
1337+ -- - response_body_like: 500 Internal Server Error
1338+ -- - error_code: 500
1339+ -- - error_log
1340+ at least one coroutine should be specified
1341+ -- - no_error_log
1342+ [crit]
You can’t perform that action at this time.
0 commit comments