Merge pull request #6350 from nekto0n/fix_message_limit

rafthttp: fix misprint in readBytesLimit value
This commit is contained in:
Gyu-Ho Lee 2016-09-05 15:26:19 +09:00 committed by GitHub
commit 1ebeef5cbf
2 changed files with 7 additions and 1 deletions

View File

@ -43,7 +43,7 @@ type messageDecoder struct {
}
var (
readBytesLimit uint64 = 512 * 1024 // 512 MB
readBytesLimit uint64 = 512 * 1024 * 1024 // 512 MB
ErrExceedSizeLimit = errors.New("rafthttp: error limit exceeded")
)

View File

@ -23,6 +23,12 @@ import (
)
func TestMessage(t *testing.T) {
// Lower readBytesLimit to make test pass in restricted resources environment
originalLimit := readBytesLimit
readBytesLimit = 1000
defer func() {
readBytesLimit = originalLimit
}()
tests := []struct {
msg raftpb.Message
encodeErr error