cap max msg size to min(max_int, max_uint32) (#1598)

This commit is contained in:
lyuxuan
2017-10-24 10:20:54 -07:00
committed by GitHub
parent 0d57c57a68
commit 5856538706
3 changed files with 36 additions and 8 deletions

View File

@ -206,6 +206,7 @@ func FailFast(failFast bool) CallOption {
}
// MaxCallRecvMsgSize returns a CallOption which sets the maximum message size the client can receive.
// Note that the maximum effective value is MaxUint32 due to protocol limitations.
func MaxCallRecvMsgSize(s int) CallOption {
return beforeCall(func(o *callInfo) error {
o.maxReceiveMessageSize = &s
@ -214,6 +215,7 @@ func MaxCallRecvMsgSize(s int) CallOption {
}
// MaxCallSendMsgSize returns a CallOption which sets the maximum message size the client can send.
// Note that the maximum effective value is MaxUint32 due to protocol limitations.
func MaxCallSendMsgSize(s int) CallOption {
return beforeCall(func(o *callInfo) error {
o.maxSendMessageSize = &s