We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e7f83e7 commit a836734Copy full SHA for a836734
test/test_multi_callback.lua
@@ -2,10 +2,17 @@ local curl = require "lcurl"
2
3
local called, active_coroutine = 0
4
5
+-- for Lua 5.1 compat
6
+local function co_running()
7
+ local co, main = coroutine.running()
8
+ if main == true then return nil end
9
+ return co
10
+end
11
+
12
function on_timer()
13
called = called + 1
14
-- use `os.exit` because now Lua-cURL did not propogate error from callback
- if coroutine.running() ~= active_coroutine then os.exit(-1) end
15
+ if co_running() ~= active_coroutine then os.exit(-1) end
16
end
17
18
local function test_1()
0 commit comments