Skip to content

Commit c9ed7c6

Browse files
committed
Fix. Use weak table as pointer for socket action.
1 parent cf3203e commit c9ed7c6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/lua/cURL/impl/cURL.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,8 +670,9 @@ local function wrap_callback(...)
670670
end
671671

672672
local function wrap_socketfunction(self, cb)
673+
local ptr = setmetatable({value = self},{__mode = 'v'})
673674
return function(h, ...)
674-
local e = self._easy[h]
675+
local e = ptr.value._easy[h]
675676
if e then return cb(e, ...) end
676677
return 0
677678
end

0 commit comments

Comments
 (0)