[Tarantool-patches] [PATCH V5 4/6] error: add session setting for error type marshaling
Vladislav Shpilevoy
v.shpilevoy at tarantool.org
Sat Apr 18 23:40:02 MSK 2020
Thanks for the patch!
I force pushed the following diff:
====================
diff --git a/src/box/lua/call.c b/src/box/lua/call.c
index b7ebec3b6..6c8c353ab 100644
--- a/src/box/lua/call.c
+++ b/src/box/lua/call.c
@@ -380,11 +380,6 @@ execute_lua_eval(lua_State *L)
struct encode_lua_ctx {
struct port_lua *port;
struct mpstream *stream;
- /**
- * Lua serializer additional options.
- * To set the session specific serialization options.
- */
- struct serializer_opts *serializer_opts;
};
static int
@@ -398,11 +393,10 @@ encode_lua_call(lua_State *L)
* TODO: forbid explicit yield from __serialize or __index here
*/
struct luaL_serializer *cfg = luaL_msgpack_default;
+ struct serializer_opts *opts = ¤t_session()->meta.serializer_opts;
int size = lua_gettop(ctx->port->L);
- for (int i = 1; i <= size; ++i) {
- luamp_encode(ctx->port->L, cfg, ctx->serializer_opts,
- ctx->stream, i);
- }
+ for (int i = 1; i <= size; ++i)
+ luamp_encode(ctx->port->L, cfg, opts, ctx->stream, i);
ctx->port->size = size;
mpstream_flush(ctx->stream);
return 0;
@@ -437,7 +431,6 @@ port_lua_do_dump(struct port *base, struct mpstream *stream,
struct encode_lua_ctx ctx;
ctx.port = port;
ctx.stream = stream;
- ctx.serializer_opts = ¤t_session()->meta.serializer_opts;
struct lua_State *L = tarantool_L;
int top = lua_gettop(L);
if (lua_cpcall(L, handler, &ctx) != 0) {
====================
More information about the Tarantool-patches
mailing list