Skip to content

Commit

Permalink
context增加abort函数中断调用流程
Browse files Browse the repository at this point in the history
  • Loading branch information
huahua132 committed Nov 9, 2023
1 parent 26f16e5 commit 1bbc1c5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lualib/wlua/context.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ function M:next()
end
end

--中断调用,比如中间件验证失败
function M:abort()
self.index = #self.handlers + 1
end

-- M:send(text, status, content_type)
function M:send(...)
self.res:send(...)
Expand Down

0 comments on commit 1bbc1c5

Please sign in to comment.