You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I have the following piece of code in the init_by_lua_file in the http context
local http = require "resty.http"
local httpc = http.newCoSocket()
where I have added
function _M.newCoSocket()
local sock = socket.tcp() -- similar to ngx.socket.tcp().
return setmetatable({.
sock = sock.
}, {__index = _M}).
end.
function _M:connect(host, port)
local ok, err = self.sock:connect(host, port)
if not ok then
return nil, err
end
local times, err = self.sock:getreusedtimes() -- cosocket API
if not times then
return nil, err
elseif times == 0 then
-- handle connection
end
end
to the http.lua file.
I get the following error on startup
socket.lua:167: stack overflow
The line 167 is local phase = get_phase()
The text was updated successfully, but these errors were encountered:
So I have the following piece of code in the init_by_lua_file in the http context
where I have added
to the http.lua file.
I get the following error on startup
socket.lua:167: stack overflow
The line 167 is
local phase = get_phase()
The text was updated successfully, but these errors were encountered: