diff options
author | Yash Tibrewal <yashkt@google.com> | 2018-05-15 16:39:16 -0700 |
---|---|---|
committer | Yash Tibrewal <yashkt@google.com> | 2018-05-15 16:39:16 -0700 |
commit | efee8f227d6c0beb1000351a1c20e6ab8df76380 (patch) | |
tree | d225a949d983602faf40efc922cd6facd14ff6f2 /src/cpp | |
parent | 95b7e9fd8b491904ad821f14c8c391a77d89b650 (diff) |
Allow unlimited as the max receive message length
Diffstat (limited to 'src/cpp')
-rw-r--r-- | src/cpp/server/server_builder.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cpp/server/server_builder.cc b/src/cpp/server/server_builder.cc index e951801965..a05e544719 100644 --- a/src/cpp/server/server_builder.cc +++ b/src/cpp/server/server_builder.cc @@ -39,8 +39,8 @@ static void do_plugin_list_init(void) { } ServerBuilder::ServerBuilder() - : max_receive_message_size_(-1), - max_send_message_size_(-1), + : max_receive_message_size_(-2), // -1 is unlimited and is not the default + max_send_message_size_(-1), // -1 is unlimited and is the default sync_server_settings_(SyncServerSettings()), resource_quota_(nullptr), generic_service_(nullptr) { @@ -186,7 +186,7 @@ std::unique_ptr<Server> ServerBuilder::BuildAndStart() { (*plugin)->UpdateChannelArguments(&args); } - if (max_receive_message_size_ >= 0) { + if (max_receive_message_size_ >= -1) { args.SetInt(GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH, max_receive_message_size_); } |