func (rs requestStrategyDuplicateRequestTimeout) nominalMaxRequests(cn requestStrategyConnection) (ret int) {
	expectingTime := int64(cn.totalExpectingTime())
	if expectingTime == 0 {
		expectingTime = math.MaxInt64
	} else {
		expectingTime *= 2
	}
	return int(clamp(
		1,
		int64(cn.peerMaxRequests()),
		max(
			// It makes sense to always pipeline at least one connection, since latency must be
			// non-zero.
			2,
			// Request only as many as we expect to receive in the duplicateRequestTimeout
			// window. We are trying to avoid having to duplicate requests.
			cn.chunksReceivedWhileExpecting()*int64(rs.duplicateRequestTimeout)/expectingTime,
		),
	))
}
// The actual value to use as the maximum outbound requests.
The actual value to use as the maximum outbound requests.
// The actual value to use as the maximum outbound requests .
func (rs requestStrategyDuplicateRequestTimeout) nominalMaxRequests(cn requestStrategyConnection) (ret int) {
	expectingTime := int64(cn.totalExpectingTime())
	if expectingTime == 0 {
		expectingTime = math.MaxInt64
	} else {
		expectingTime *= 2
	}
	return int(clamp(
		1,
		int64(cn.peerMaxRequests()),
		max(
			2,
			cn.chunksReceivedWhileExpecting()*int64(rs.duplicateRequestTimeout)/expectingTime,
		),
	))
}
func ( rs requestStrategyDuplicateRequestTimeout ) nominalMaxRequests ( cn requestStrategyConnection ) ( ret int ) { expectingTime := int64 ( cn . totalExpectingTime ( ) ) if expectingTime == 0 { expectingTime = math . MaxInt64 } else { expectingTime *= 2 } return int ( clamp ( 1 , int64 ( cn . peerMaxRequests ( ) ) , max ( 2 , cn . chunksReceivedWhileExpecting ( ) * int64 ( rs . duplicateRequestTimeout ) / expectingTime , ) , ) ) }
The actual value to use as the maximum outbound requests.
The actual value to use as the maximum outbound requests .
// It makes sense to always pipeline at least one connection, since latency must be // non-zero. // Request only as many as we expect to receive in the duplicateRequestTimeout // window. We are trying to avoid having to duplicate requests.