Skip to content

Commit 6388487

Browse files
committed
fix: preserve Unlimited StreamsInbound in connmgr reconciliation
Fixes ipfs#9695
1 parent 5b9442c commit 6388487

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

core/node/libp2p/rcmgr_defaults.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,9 @@ func createDefaultLimitConfig(cfg config.SwarmConfig) (limitConfig rcmgr.Concret
129129
}
130130

131131
// Scale System.StreamsInbound as well, but use the existing ratio of StreamsInbound to ConnsInbound
132-
partialLimits.System.StreamsInbound = rcmgr.LimitVal(maxInboundConns * int64(partialLimits.System.StreamsInbound) / int64(partialLimits.System.ConnsInbound))
132+
if partialLimits.System.StreamsInbound != rcmgr.Unlimited {
133+
partialLimits.System.StreamsInbound = rcmgr.LimitVal(maxInboundConns * int64(partialLimits.System.StreamsInbound) / int64(partialLimits.System.ConnsInbound))
134+
}
133135
partialLimits.System.ConnsInbound = rcmgr.LimitVal(maxInboundConns)
134136
}
135137

0 commit comments

Comments
 (0)