From 10677e9067b43fb3b2555c917c322b4454b22c77 Mon Sep 17 00:00:00 2001 From: yuhongyu879 <31095891+yuhongyu879@users.noreply.github.com> Date: Fri, 4 Jun 2021 18:48:31 +0800 Subject: [PATCH] chore: upgrade protobuf to 0.3.2 (#4368) Co-authored-by: leonnyu --- 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 83b6f38b..9f828906 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 62076107..f91ba686 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",