You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by jk...@apache.org on 2018/07/05 13:29:57 UTC

[thrift] branch master updated: THRIFT-4591: optimize lua client to use one write per framed message (#1566)

This is an automated email from the ASF dual-hosted git repository.

jking pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/thrift.git


The following commit(s) were added to refs/heads/master by this push:
     new f12cacf  THRIFT-4591: optimize lua client to use one write per framed message (#1566)
f12cacf is described below

commit f12cacf56145e2c8f0d4429694fedf5453648089
Author: zhiyong0804 <al...@163.com>
AuthorDate: Thu Jul 5 21:29:51 2018 +0800

    THRIFT-4591: optimize lua client to use one write per framed message (#1566)
---
 lib/lua/TFramedTransport.lua | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/lua/TFramedTransport.lua b/lib/lua/TFramedTransport.lua
index 437b701..768e2d9 100644
--- a/lib/lua/TFramedTransport.lua
+++ b/lib/lua/TFramedTransport.lua
@@ -100,7 +100,7 @@ function TFramedTransport:flush()
   local tmp = self.wBuf
   self.wBuf = ''
   local frame_len_buf = libluabpack.bpack("i", string.len(tmp))
-  self.trans:write(frame_len_buf)
+  tmp = frame_len_buf .. tmp
   self.trans:write(tmp)
   self.trans:flush()
 end