• Dmitry

    Hello again! After months of pushing my limits, I "fixed" it. I think the problem is universal and not specific to any doodle above. It's maybe related to this SO question and the fix from here is to "manually turn off JIT-compilation with jit.off() for the surrounding Lua function that invokes such a message polling function (or similar)". I ended up with this:

    local curl = require("libcurl")
    jit.off(curl.multi._ret, true)

    Not sure how to measure performance hit, did I chose "less impact" function for this? And maybe something more clever can be done to fix this, without turning jit off for anything.

    posted in General Discussion read more
  • Dmitry

    Hello! I cannot make writefunction callback to work in multi transfer. It works in easy transfer, but fails in multi with the same code:
    This is on windows 7 x64, but luajit and all the dlls are 32-bit.

    local curl = require("libcurl")
    local cb = function(source, mult1, mult2, target)
        return mult1 * mult2
    local etr = curl.easy{
            url = 'http://google.com/', 
            writefunction = cb,
    local performEasy = function()
    local performMulti = function()
        local mtr = curl.multi()
        local remains
            remains = mtr:perform()
        until remains == 0
    -- performEasy()

    performEasy() works, but with performMulti() program quits with "PANIC: unprotected error in call to Lua API (bad callback)" in console.

    Maybe that's related to 4th argument to callback, it should be some "pointer" to "void" or something, over my head, I'm ignoring it in easy transfer, but maybe for multi that's not good. I planned to create separate callback functions for each easy transfer to bypass this argument thing, but cannot do even this. Does anybody use multi transfers with callbacks and how?

    posted in General Discussion read more
Internal error.

Oops! Looks like something went wrong!