From afa01aaef020d416bf9fa85f15b467d369ab5d3c Mon Sep 17 00:00:00 2001 From: Gyuho Lee Date: Tue, 30 Jan 2018 09:49:03 -0800 Subject: [PATCH] etcdmain: define "defaultGRPCMaxCallSendMsgSize" Signed-off-by: Gyuho Lee --- etcdmain/grpc_proxy.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/etcdmain/grpc_proxy.go b/etcdmain/grpc_proxy.go index 6b0865335..6a8e39feb 100644 --- a/etcdmain/grpc_proxy.go +++ b/etcdmain/grpc_proxy.go @@ -84,6 +84,8 @@ var ( grpcProxyDebug bool ) +const defaultGRPCMaxCallSendMsgSize = 1.5 * 1024 * 1024 + func init() { rootCmd.AddCommand(newGRPCProxyCommand()) } @@ -117,7 +119,7 @@ func newGRPCProxyStartCommand() *cobra.Command { cmd.Flags().StringVar(&grpcProxyNamespace, "namespace", "", "string to prefix to all keys for namespacing requests") cmd.Flags().BoolVar(&grpcProxyEnablePprof, "enable-pprof", false, `Enable runtime profiling data via HTTP server. Address is at client URL + "/debug/pprof/"`) cmd.Flags().StringVar(&grpcProxyDataDir, "data-dir", "default.proxy", "Data directory for persistent data") - cmd.Flags().IntVar(&grpcMaxCallSendMsgSize, "max-send-bytes", 1.5*1024*1024, "message send limits in bytes (default value is 1.5 MiB)") + cmd.Flags().IntVar(&grpcMaxCallSendMsgSize, "max-send-bytes", defaultGRPCMaxCallSendMsgSize, "message send limits in bytes (default value is 1.5 MiB)") cmd.Flags().IntVar(&grpcMaxCallRecvMsgSize, "max-recv-bytes", math.MaxInt32, "message receive limits in bytes (default value is math.MaxInt32)") // client TLS for connecting to server