Skip to content

Commit

Permalink
fix: preserve Unlimited StreamsInbound in connmgr reconciliation
Browse files Browse the repository at this point in the history
Fixes ipfs#9695
  • Loading branch information
Jorropo committed Mar 15, 2023
1 parent 5b9442c commit 6388487
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/node/libp2p/rcmgr_defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ func createDefaultLimitConfig(cfg config.SwarmConfig) (limitConfig rcmgr.Concret
}

// Scale System.StreamsInbound as well, but use the existing ratio of StreamsInbound to ConnsInbound
partialLimits.System.StreamsInbound = rcmgr.LimitVal(maxInboundConns * int64(partialLimits.System.StreamsInbound) / int64(partialLimits.System.ConnsInbound))
if partialLimits.System.StreamsInbound != rcmgr.Unlimited {
partialLimits.System.StreamsInbound = rcmgr.LimitVal(maxInboundConns * int64(partialLimits.System.StreamsInbound) / int64(partialLimits.System.ConnsInbound))
}
partialLimits.System.ConnsInbound = rcmgr.LimitVal(maxInboundConns)
}

Expand Down

0 comments on commit 6388487

Please sign in to comment.