Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: Leonid Vasiliev <lvasiliev@tarantool.org>,
	alexander.turenko@tarantool.org
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH V5 4/6] error: add session setting for error type marshaling
Date: Sat, 18 Apr 2020 22:40:02 +0200	[thread overview]
Message-ID: <0f714575-3e2a-2c07-0af2-db5df5ffe97e@tarantool.org> (raw)
In-Reply-To: <021fb05beca144686861a6b8499088ef9e88ca28.1587223627.git.lvasiliev@tarantool.org>

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 = &current_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 = &current_session()->meta.serializer_opts;
 	struct lua_State *L = tarantool_L;
 	int top = lua_gettop(L);
 	if (lua_cpcall(L, handler, &ctx) != 0) {

====================

  reply	other threads:[~2020-04-18 20:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-18 15:29 [Tarantool-patches] [PATCH V5 0/6] Extending error functionality Leonid Vasiliev
2020-04-18 15:29 ` [Tarantool-patches] [PATCH V5 1/6] error: add custom error type Leonid Vasiliev
2020-04-18 18:52   ` Vladislav Shpilevoy
2020-04-18 15:29 ` [Tarantool-patches] [PATCH V5 2/6] error: send custom type in IProto Leonid Vasiliev
2020-04-18 20:39   ` Vladislav Shpilevoy
2020-04-18 15:29 ` [Tarantool-patches] [PATCH V5 3/6] session: add offset to SQL session settings array Leonid Vasiliev
2020-04-18 15:29 ` [Tarantool-patches] [PATCH V5 4/6] error: add session setting for error type marshaling Leonid Vasiliev
2020-04-18 20:40   ` Vladislav Shpilevoy [this message]
2020-04-18 15:29 ` [Tarantool-patches] [PATCH V5 5/6] error: update constructors of some errors Leonid Vasiliev
2020-04-18 20:39   ` Vladislav Shpilevoy
2020-04-18 15:29 ` [Tarantool-patches] [PATCH V5 6/6] error: add error MsgPack encoding Leonid Vasiliev
2020-04-18 20:39   ` Vladislav Shpilevoy
2020-04-18 21:14 ` [Tarantool-patches] [PATCH V5 5.5/6] box: move Lua MP_EXT decoder from tuple.c Vladislav Shpilevoy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0f714575-3e2a-2c07-0af2-db5df5ffe97e@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=alexander.turenko@tarantool.org \
    --cc=lvasiliev@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH V5 4/6] error: add session setting for error type marshaling' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox