Increase file limit from 100.000 to 1.000.000

This commit is contained in:
Jakob Borg 2014-05-13 09:59:17 -03:00
parent 602d7e8d18
commit 0d3caa2183
3 changed files with 4 additions and 4 deletions

View File

@ -575,7 +575,7 @@ restrictive than the following:
### Index and Index Update Messages ### Index and Index Update Messages
- Repository: 64 bytes - Repository: 64 bytes
- Number of Files: 100.000 - Number of Files: 1.000.000
- Name: 1024 bytes - Name: 1024 bytes
- Number of Blocks: 100.000 - Number of Blocks: 100.000
- Hash: 64 bytes - Hash: 64 bytes

View File

@ -2,7 +2,7 @@ package protocol
type IndexMessage struct { type IndexMessage struct {
Repository string // max:64 Repository string // max:64
Files []FileInfo // max:100000 Files []FileInfo // max:1000000
} }
type FileInfo struct { type FileInfo struct {

View File

@ -24,7 +24,7 @@ func (o IndexMessage) encodeXDR(xw *xdr.Writer) (int, error) {
return xw.Tot(), xdr.ErrElementSizeExceeded return xw.Tot(), xdr.ErrElementSizeExceeded
} }
xw.WriteString(o.Repository) xw.WriteString(o.Repository)
if len(o.Files) > 100000 { if len(o.Files) > 1000000 {
return xw.Tot(), xdr.ErrElementSizeExceeded return xw.Tot(), xdr.ErrElementSizeExceeded
} }
xw.WriteUint32(uint32(len(o.Files))) 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 { func (o *IndexMessage) decodeXDR(xr *xdr.Reader) error {
o.Repository = xr.ReadStringMax(64) o.Repository = xr.ReadStringMax(64)
_FilesSize := int(xr.ReadUint32()) _FilesSize := int(xr.ReadUint32())
if _FilesSize > 100000 { if _FilesSize > 1000000 {
return xdr.ErrElementSizeExceeded return xdr.ErrElementSizeExceeded
} }
o.Files = make([]FileInfo, _FilesSize) o.Files = make([]FileInfo, _FilesSize)