From: Remi Gacogne Date: Mon, 12 Mar 2018 16:20:26 +0000 (+0100) Subject: rec: Instruct LuaWrapper to stay away from our FFI pdns_ffi_param struct X-Git-Tag: dnsdist-1.3.0~34^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4a639c365df629466e4a2916360a41d8a4302144;p=thirdparty%2Fpdns.git rec: Instruct LuaWrapper to stay away from our FFI pdns_ffi_param struct --- diff --git a/pdns/lua-recursor4.hh b/pdns/lua-recursor4.hh index 6f63083145..e25cd62dae 100644 --- a/pdns/lua-recursor4.hh +++ b/pdns/lua-recursor4.hh @@ -40,6 +40,18 @@ string GenUDPQueryResponse(const ComboAddress& dest, const string& query); unsigned int getRecursorThreadId(); +// pdns_ffi_param_t is a lightuserdata +template<> +struct LuaContext::Pusher { + static const int minSize = 1; + static const int maxSize = 1; + + static PushedObject push(lua_State* state, pdns_ffi_param* ptr) noexcept { + lua_pushlightuserdata(state, ptr); + return PushedObject{state, 1}; + } +}; + class RecursorLua4 : public BaseLua4 { public: