Skip to content

Commit

Permalink
[Network] Fix chunk datapack size and timeout limits (#4623)
Browse files Browse the repository at this point in the history
  • Loading branch information
peterargue authored Aug 15, 2023
1 parent cc67154 commit 99233ab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions network/p2p/middleware/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,7 @@ func (m *Middleware) IsConnected(nodeID flow.Identifier) (bool, error) {
// unicastMaxMsgSize returns the max permissible size for a unicast message
func unicastMaxMsgSize(messageType string) int {
switch messageType {
case "*messages.ChunkDataResponse":
case "*messages.ChunkDataResponse", "messages.ChunkDataResponse":
return LargeMsgMaxUnicastMsgSize
default:
return DefaultMaxUnicastMsgSize
Expand All @@ -843,7 +843,7 @@ func UnicastMaxMsgSizeByCode(payload []byte) (int, error) {
// unicastMaxMsgDuration returns the max duration to allow for a unicast send to complete
func (m *Middleware) unicastMaxMsgDuration(messageType string) time.Duration {
switch messageType {
case "messages.ChunkDataResponse":
case "*messages.ChunkDataResponse", "messages.ChunkDataResponse":
if LargeMsgUnicastTimeout > m.unicastMessageTimeout {
return LargeMsgUnicastTimeout
}
Expand Down

0 comments on commit 99233ab

Please sign in to comment.