From a782301ecfb35eac1dc668a8009d232762b8f508 Mon Sep 17 00:00:00 2001 From: Chunxiang Zheng Date: Thu, 31 Oct 2024 21:40:01 +0000 Subject: [PATCH] Increase RPC size limit for tff_server to 2GB. Change-Id: I52ae0c94e672db5cecbdc8bd43eaae9f375510ad --- containers/tff_server/main.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/containers/tff_server/main.cc b/containers/tff_server/main.cc index cfcc906..7bc79ef 100644 --- a/containers/tff_server/main.cc +++ b/containers/tff_server/main.cc @@ -35,6 +35,9 @@ using ::grpc::ServerBuilder; using ::oak::containers::Orchestrator; using ::oak::containers::v1::OrchestratorCrypto; +// Increase gRPC message size limit to 2GB +static constexpr int kChannelMaxMessageSize = 2 * 1000 * 1000 * 1000; + void RunServer() { std::string server_address("[::]:8080"); std::shared_ptr orchestrator_channel = @@ -43,6 +46,8 @@ void RunServer() { OrchestratorCrypto::Stub orchestrator_crypto_stub(orchestrator_channel); TffConfidentialTransform service(&orchestrator_crypto_stub); ServerBuilder builder; + builder.SetMaxReceiveMessageSize(kChannelMaxMessageSize); + builder.SetMaxSendMessageSize(kChannelMaxMessageSize); builder.AddListeningPort(server_address, grpc::InsecureServerCredentials()); builder.RegisterService(&service); std::unique_ptr server = builder.BuildAndStart();