From 3052cff7537d0a1d226f6fdc97338114ac88baad Mon Sep 17 00:00:00 2001 From: Yash Tibrewal Date: Thu, 7 Jun 2018 14:03:00 -0700 Subject: [PATCH] Change comments --- src/cpp/server/server_builder.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/cpp/server/server_builder.cc b/src/cpp/server/server_builder.cc index a05e544719c..7f5b439dfba 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_(-2), // -1 is unlimited and is not the default - max_send_message_size_(-1), // -1 is unlimited and is the default + : max_receive_message_size_(INT_MIN), + max_send_message_size_(INT_MIN), sync_server_settings_(SyncServerSettings()), resource_quota_(nullptr), generic_service_(nullptr) { @@ -190,6 +190,8 @@ std::unique_ptr ServerBuilder::BuildAndStart() { args.SetInt(GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH, max_receive_message_size_); } + // The default message size is -1 (max), so no need to explicitly set it for + // -1. if (max_send_message_size_ >= 0) { args.SetInt(GRPC_ARG_MAX_SEND_MESSAGE_LENGTH, max_send_message_size_); }