Browse Source

Bump max file size and count

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

+ 2 - 2
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

+ 2 - 2
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 {

+ 4 - 4
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)