Skip to content

Commit

Permalink
Increase RPC size limit for tff_server to 2GB.
Browse files Browse the repository at this point in the history
Change-Id: I52ae0c94e672db5cecbdc8bd43eaae9f375510ad
  • Loading branch information
chunxiangzheng committed Oct 31, 2024
1 parent 60f0be7 commit a782301
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions containers/tff_server/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<grpc::Channel> orchestrator_channel =
Expand All @@ -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> server = builder.BuildAndStart();
Expand Down

0 comments on commit a782301

Please sign in to comment.