You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by to...@apache.org on 2021/06/04 10:48:42 UTC

[apisix] branch master updated: chore: upgrade protobuf to 0.3.2 (#4368)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 10677e9  chore: upgrade protobuf to 0.3.2 (#4368)
10677e9 is described below

commit 10677e9067b43fb3b2555c917c322b4454b22c77
Author: yuhongyu879 <31...@users.noreply.github.com>
AuthorDate: Fri Jun 4 18:48:31 2021 +0800

    chore: upgrade protobuf to 0.3.2 (#4368)
    
    Co-authored-by: leonnyu <le...@tencent.com>
---
 apisix/plugins/grpc-transcode/proto.lua | 7 ++++++-
 rockspec/apisix-master-0.rockspec       | 2 +-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/apisix/plugins/grpc-transcode/proto.lua b/apisix/plugins/grpc-transcode/proto.lua
index 83b6f38..9f82890 100644
--- a/apisix/plugins/grpc-transcode/proto.lua
+++ b/apisix/plugins/grpc-transcode/proto.lua
@@ -43,7 +43,12 @@ local function create_proto_obj(proto_id)
     end
 
     local _p  = protoc.new()
-    local res = _p:load(content)
+    -- the loaded proto won't appears in _p.loaded without a file name after lua-protobuf=0.3.2,
+    -- which means _p.loaded after _p:load(content) is always empty, so we can pass a fake file
+    -- name to keep the code below unchanged, or we can create our own load function with returning
+    -- the loaded DescriptorProto table additionally, see more details in
+    -- https://github.com/apache/apisix/pull/4368
+    local res = _p:load(content, "filename for loaded")
 
     if not res or not _p.loaded then
         return nil, "failed to load proto content"
diff --git a/rockspec/apisix-master-0.rockspec b/rockspec/apisix-master-0.rockspec
index 6207610..f91ba68 100644
--- a/rockspec/apisix-master-0.rockspec
+++ b/rockspec/apisix-master-0.rockspec
@@ -45,7 +45,7 @@ dependencies = {
     "lua-resty-session = 2.24",
     "opentracing-openresty = 0.1",
     "lua-resty-radixtree = 2.8.0",
-    "lua-protobuf = 0.3.1",
+    "lua-protobuf = 0.3.2",
     "lua-resty-openidc = 1.7.2-1",
     "luafilesystem = 1.7.0-2",
     "lua-tinyyaml = 1.0",