diff --git a/examples/cURLv3/uvwget.lua b/examples/cURLv3/uvwget.lua index 8341e1d..a4e68bc 100644 --- a/examples/cURLv3/uvwget.lua +++ b/examples/cURLv3/uvwget.lua @@ -175,9 +175,11 @@ on_curl_timeout = function(ms) -- calls by curl -- trace("CURL::TIMEOUT", ms) - if ms <= 0 then ms = 1 end + if not timer:active() then + if ms <= 0 then ms = 1 end - timer:start(ms, 0, on_libuv_timeout) + timer:start(ms, 0, on_libuv_timeout) + end end on_curl_action = function(easy, fd, action) diff --git a/src/lua/cURL/impl/cURL.lua b/src/lua/cURL/impl/cURL.lua index 48e5b31..dac178c 100644 --- a/src/lua/cURL/impl/cURL.lua +++ b/src/lua/cURL/impl/cURL.lua @@ -661,7 +661,7 @@ local setopt_socketfunction = wrap_function("setopt_socketfunction") function Multi:setopt_socketfunction(...) local cb = wrap_callback(...) - return setopt_socketfunction(wrap_socketfunction(self, cb)) + return setopt_socketfunction(self, wrap_socketfunction(self, cb)) end local setopt = wrap_function("setopt")