Skip to content

Commit 403b413

Browse files
authored
Merge pull request #191 from anyproto/fix-push-many-limit
BlockPushMany: Fix bytes limit
2 parents b8c6e51 + 2cd7481 commit 403b413

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

filenode/rpchandler.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ import (
1313
)
1414

1515
const (
16-
cidSizeLimit = 4 << 20 // 4 Mb
17-
fileInfoReqLimit = 1000
16+
blockPushManyTotalLimit = 20 << 20 // 20 Mb
17+
cidSizeLimit = 4 << 20 // 4 Mb
18+
fileInfoReqLimit = 1000
1819
)
1920

2021
type rpcHandler struct {
@@ -133,7 +134,7 @@ func (r rpcHandler) BlockPushMany(ctx context.Context, req *fileproto.BlockPushM
133134
return nil, ErrWrongHash
134135
}
135136
dataSum += len(b.RawData())
136-
if dataSum > fileInfoReqLimit {
137+
if dataSum > blockPushManyTotalLimit {
137138
return nil, fileprotoerr.ErrQuerySizeExceeded
138139
}
139140
bs = append(bs, b)

0 commit comments

Comments
 (0)