mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-08 22:31:04 +00:00
Increase file limit from 100.000 to 1.000.000
This commit is contained in:
parent
602d7e8d18
commit
0d3caa2183
@ -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
|
||||
|
@ -2,7 +2,7 @@ package protocol
|
||||
|
||||
type IndexMessage struct {
|
||||
Repository string // max:64
|
||||
Files []FileInfo // max:100000
|
||||
Files []FileInfo // max:1000000
|
||||
}
|
||||
|
||||
type FileInfo struct {
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user