Browse Source

Increase file limit from 100.000 to 1.000.000

Jakob Borg 11 years ago
parent
commit
0d3caa2183
3 changed files with 4 additions and 4 deletions
  1. 1 1
      protocol/PROTOCOL.md
  2. 1 1
      protocol/message_types.go
  3. 2 2
      protocol/message_xdr.go

+ 1 - 1
protocol/PROTOCOL.md

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

+ 1 - 1
protocol/message_types.go

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

+ 2 - 2
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) > 100000 {
+	if len(o.Files) > 1000000 {
 		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 > 100000 {
+	if _FilesSize > 1000000 {
 		return xdr.ErrElementSizeExceeded
 	}
 	o.Files = make([]FileInfo, _FilesSize)