Skip to content
Snippets Groups Projects
Commit cef230bd authored by Vladimir Davydov's avatar Vladimir Davydov Committed by Konstantin Osipov
Browse files

call: refactor lua CALL/EVAL handling

Currently, we execute a Lua function/expression and dump the result to
an output buffer in the same function invoked under lua_cpcall().
Although this allows us to use only one pcall to handle a call request,
this also makes box_lua_call() and box_lua_eval() dependent on the
iproto format (they have to use iproto_reply_select()), which is ugly.
What is worse, the caller has to pass the output buffer right away while
in case of iproto it can change if the invoked Lua function yields
(iproto switches buffers once in a while to reclaim memory).

That being said, we'd better decouple the call itself from the result
dump. Let's start from using two pcalls - one for executing the Lua
expression and another for dumping arguments - and moving iproto
dependent code out of Lua callbacks.

Needed for #946
parent 13d50af5
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment