> On 8 Mar 2018, at 15:03, Tim Düsterhus <[email protected]> wrote:
>
> Thierry,
>
> Am 08.03.2018 um 10:24 schrieb Thierry Fournier:
>> I forgot 3 things while my first read:
>>
>> - The Lua error are not trigerred with a return 1 (the return 1 is a bug
>> in the original function), but with something like that:
>>
>
> Your first patch will be regressing my commit
> 119a5f10e47f3507e58116002583e1226473485d, which specifically changed the
> return value to be 1 for compatibility with the standard Socket class of
> Lua!
>
> http://git.haproxy.org/?p=haproxy.git;a=commit;h=119a5f10e47f3507e58116002583e1226473485d
Ok, Lua expect the number of elements ins the stack. The right way for
returning 1 is:
lua_pushinteger(L, 1);
return 1;
I will add this in the patch.
BR,
Thierry