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

This reverts commit 5856538706dc3abc44dd5ba1a8bb19a0dfb1ab25.
This commit is contained in:
dfawley
2017-10-25 10:31:00 -07:00
committed by GitHub
parent 5856538706
commit c5f391bd6c
3 changed files with 8 additions and 36 deletions

View File

@ -208,27 +208,17 @@ func MaxMsgSize(m int) ServerOption {
// MaxRecvMsgSize returns a ServerOption to set the max message size in bytes the server can receive.
// If this is not set, gRPC uses the default 4MB.
// Note that the maximum effective value is MaxUint32 due to protocol limitations.
func MaxRecvMsgSize(m int) ServerOption {
return func(o *options) {
if int64(m) > int64(math.MaxUint32) {
o.maxReceiveMessageSize = math.MaxUint32
} else {
o.maxReceiveMessageSize = m
}
o.maxReceiveMessageSize = m
}
}
// MaxSendMsgSize returns a ServerOption to set the max message size in bytes the server can send.
// If this is not set, gRPC uses the default 4MB.
// Note that the maximum effective value is MaxUint32 due to protocol limitations.
func MaxSendMsgSize(m int) ServerOption {
return func(o *options) {
if int64(m) > int64(math.MaxUint32) {
o.maxSendMessageSize = math.MaxUint32
} else {
o.maxSendMessageSize = m
}
o.maxSendMessageSize = m
}
}