THRIFT-5260 Fix the thrift compiler generate problematic lua code for the oneway method
Client: lua
Patch: longzhiri <persistentsnail@gmail.com>
This closes #2212
The oneway method's processor has no need to write the result to client, but it is necessary to return values of each handler's return.
diff --git a/test/lua/test_basic_client.lua b/test/lua/test_basic_client.lua
index 77d8d07..11567d9 100644
--- a/test/lua/test_basic_client.lua
+++ b/test/lua/test_basic_client.lua
@@ -172,6 +172,9 @@
assertEqual(o.i32_thing, r.i32_thing, 'Failed testStruct 3')
assertEqual(o.i64_thing, r.i64_thing, 'Failed testStruct 4')
+ -- oneway
+ client:testOneway(3)
+
-- TODO add list map set exception etc etc
end
diff --git a/test/lua/test_basic_server.lua b/test/lua/test_basic_server.lua
index acd2d79..20ac407 100644
--- a/test/lua/test_basic_server.lua
+++ b/test/lua/test_basic_server.lua
@@ -66,6 +66,10 @@
return thing
end
+function TestHandler:testOneway(secondsToSleep)
+ print("testOneway secondsToSleep:", secondsToSleep)
+end
+
--------------------------------------------------------------------------------
-- Test
local server
@@ -132,6 +136,7 @@
protocolFactory = prot_factory
}
assert(server, 'Failed to create server')
+ server:setExceptionHandler(function (err) error(err) end)
-- Serve
server:serve()