From 2d272a3cac3e306da97cd16527ac4acc87cfceb1 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Sat, 5 Jul 2014 11:05:45 +0200 Subject: [PATCH] Bump max file size and count --- protocol/PROTOCOL.md | 4 ++-- protocol/message_types.go | 4 ++-- protocol/message_xdr.go | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/protocol/PROTOCOL.md b/protocol/PROTOCOL.md index 48d5332b2..385f4335d 100644 --- a/protocol/PROTOCOL.md +++ b/protocol/PROTOCOL.md @@ -597,9 +597,9 @@ restrictive than the following: ### Index and Index Update Messages - Repository: 64 bytes - - Number of Files: 1.000.000 + - Number of Files: 10.000.000 - Name: 1024 bytes - - Number of Blocks: 100.000 + - Number of Blocks: 1.000.000 - Hash: 64 bytes ### Request Messages diff --git a/protocol/message_types.go b/protocol/message_types.go index 24ec038ab..f4bc93423 100644 --- a/protocol/message_types.go +++ b/protocol/message_types.go @@ -6,7 +6,7 @@ package protocol type IndexMessage struct { Repository string // max:64 - Files []FileInfo // max:1000000 + Files []FileInfo // max:10000000 } type FileInfo struct { @@ -14,7 +14,7 @@ type FileInfo struct { Flags uint32 Modified int64 Version uint64 - Blocks []BlockInfo // max:100000 + Blocks []BlockInfo // max:1000000 } type BlockInfo struct { diff --git a/protocol/message_xdr.go b/protocol/message_xdr.go index 950086ba8..b95bf783d 100644 --- a/protocol/message_xdr.go +++ b/protocol/message_xdr.go @@ -24,7 +24,7 @@ func (o IndexMessage) encodeXDR(xw *xdr.Writer) (int, error) { return xw.Tot(), xdr.ErrElementSizeExceeded } xw.WriteString(o.Repository) - if len(o.Files) > 1000000 { + if len(o.Files) > 10000000 { return xw.Tot(), xdr.ErrElementSizeExceeded } xw.WriteUint32(uint32(len(o.Files))) @@ -48,7 +48,7 @@ func (o *IndexMessage) UnmarshalXDR(bs []byte) error { func (o *IndexMessage) decodeXDR(xr *xdr.Reader) error { o.Repository = xr.ReadStringMax(64) _FilesSize := int(xr.ReadUint32()) - if _FilesSize > 1000000 { + if _FilesSize > 10000000 { return xdr.ErrElementSizeExceeded } o.Files = make([]FileInfo, _FilesSize) @@ -78,7 +78,7 @@ func (o FileInfo) encodeXDR(xw *xdr.Writer) (int, error) { xw.WriteUint32(o.Flags) xw.WriteUint64(uint64(o.Modified)) xw.WriteUint64(o.Version) - if len(o.Blocks) > 100000 { + if len(o.Blocks) > 1000000 { return xw.Tot(), xdr.ErrElementSizeExceeded } xw.WriteUint32(uint32(len(o.Blocks))) @@ -105,7 +105,7 @@ func (o *FileInfo) decodeXDR(xr *xdr.Reader) error { o.Modified = int64(xr.ReadUint64()) o.Version = xr.ReadUint64() _BlocksSize := int(xr.ReadUint32()) - if _BlocksSize > 100000 { + if _BlocksSize > 1000000 { return xdr.ErrElementSizeExceeded } o.Blocks = make([]BlockInfo, _BlocksSize)