You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/02/01 04:21:39 UTC
[jira] [Commented] (THRIFT-3585) compact protocol implement of lua
for thrift.
[ https://issues.apache.org/jira/browse/THRIFT-3585?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15125684#comment-15125684 ]
ASF GitHub Bot commented on THRIFT-3585:
----------------------------------------
GitHub user mygityf opened a pull request:
https://github.com/apache/thrift/pull/827
THRIFT-3585 Lua: compact protocol implement of lua for thrift.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/gityf/thrift lua-library
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/thrift/pull/827.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #827
----
commit 0d0cf5aa589389d40a2bd71a9e09e790634aff36
Author: unknown <wa...@xz-20141016zrqg.didichuxing.com>
Date: 2016-01-28T11:08:05Z
To check element of self whether nil or not,avoid the value(false) of BOOL is lost.
eg.
Before:
if self.argBool then
oprot:writeFieldBegin('argBool', TType.BOOL, 13)
oprot:writeBool(self.argBool)
oprot:writeFieldEnd()
end
After:
if self.argBool ~= nil then
oprot:writeFieldBegin('argBool', TType.BOOL, 13)
oprot:writeBool(self.argBool)
oprot:writeFieldEnd()
end
Why:
the value(false) for paramater self.argBool will be lost when condition is 'if self.argBool then' as before.
commit 8e61f5ae5cd82ede21d2fad0c67e9328a57a9bc5
Author: unknown <wa...@xz-20141016zrqg.didichuxing.com>
Date: 2016-01-28T11:29:54Z
This is compact protocol lua implement for thrift.
Here are some description for each source code file.
luabpack.c
To add bits operation function for thrift compact protocol.
new functions:
l_i64ToZigza,l_i32ToZigzag,l_zigzagToI32,l_zigzagToI64,l_toVarint32,l_toVarint64,l_packMesgType.
TCompactProtocol.lua
new source of lua for thrift compact protocol.
compact_protocol_client.lua
test client source code for thrift compact protocol.
compact_protocol_server.lua
test server source code for thrift compact protocol.
rpc.thrift
test thrift IDL file for test case(compact_protocol_client.lua,compact_protocol_server.lua).
pcap offset hex of rpc test service.txt
This is dump file create by tcpdump for test case.
Test cases:
client <--------------> server
compact_protocol_client.lua compact_server.go (golang thrift server)
compact_client.go (golang thrift client) compact_protocol_server.lua
compact_protocol_client.lua compact_protocol_server.lua
Test console log:
log for compact_protocol_client.lua:
1 return 1 by FunCall.
2 return 2 by FunCall.
log for compact_protocol_server.lua:
53 54 12 43 11.22 str value
53 54 12 34 11.22 login
name namess
pass vpass
10 val10
20 val20
ele1
ele3
ele2
l1.
l2.
----
> compact protocol implement of lua for thrift.
> ---------------------------------------------
>
> Key: THRIFT-3585
> URL: https://issues.apache.org/jira/browse/THRIFT-3585
> Project: Thrift
> Issue Type: Improvement
> Components: Lua - Library
> Affects Versions: 0.9.3
> Environment: Linux Mac Windows
> Reporter: WangYaofu
> Labels: patch
> Fix For: 0.9.4
>
>
> This is compact protocol lua implement for thrift.
> Here are some description for each source code file.
> luabpack.c
> To add bits operation function for thrift compact protocol.
> new functions:
> l_i64ToZigza,l_i32ToZigzag,l_zigzagToI32,l_zigzagToI64,l_toVarint32,l_toVarint64,l_packMesgType.
> TCompactProtocol.lua
> new source of lua for thrift compact protocol.
> compact_protocol_client.lua
> test client source code for thrift compact protocol.
> compact_protocol_server.lua
> test server source code for thrift compact protocol.
> rpc.thrift
> test thrift IDL file for test case(compact_protocol_client.lua,compact_protocol_server.lua).
> pcap offset hex of rpc test service.txt
> This is dump file create by tcpdump for test case.
> Test cases:
> client <--------------> server
> compact_protocol_client.lua compact_server.go (golang thrift server)
> compact_client.go (golang thrift client) compact_protocol_server.lua
> compact_protocol_client.lua compact_protocol_server.lua
> Test console log:
> log for compact_protocol_client.lua:
> 1 return 1 by FunCall.
> 2 return 2 by FunCall.
> log for compact_protocol_server.lua:
> 53 54 12 43 11.22 str value
> 53 54 12 34 11.22 login
> name namess
> pass vpass
> 10 val10
> 20 val20
> ele1
> ele3
> ele2
> l1.
> l2.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)