mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-03 04:07:35 +03:00
use an int64 for Config.MaxIncoming{Uni}Streams
This commit is contained in:
parent
d7c2169c55
commit
ce24f7e46f
3 changed files with 10 additions and 10 deletions
|
@ -487,8 +487,8 @@ var _ = Describe("Client", func() {
|
|||
c := populateClientConfig(config, false)
|
||||
Expect(c.HandshakeTimeout).To(Equal(1337 * time.Minute))
|
||||
Expect(c.MaxIdleTimeout).To(Equal(42 * time.Hour))
|
||||
Expect(c.MaxIncomingStreams).To(Equal(1234))
|
||||
Expect(c.MaxIncomingUniStreams).To(Equal(4321))
|
||||
Expect(c.MaxIncomingStreams).To(BeEquivalentTo(1234))
|
||||
Expect(c.MaxIncomingUniStreams).To(BeEquivalentTo(4321))
|
||||
Expect(c.ConnectionIDLength).To(Equal(13))
|
||||
Expect(c.StatelessResetKey).To(Equal([]byte("foobar")))
|
||||
Expect(c.QuicTracer).To(Equal(tracer))
|
||||
|
@ -511,7 +511,7 @@ var _ = Describe("Client", func() {
|
|||
}
|
||||
c := populateClientConfig(config, false)
|
||||
Expect(c.MaxIncomingStreams).To(BeZero())
|
||||
Expect(c.MaxIncomingUniStreams).To(Equal(4321))
|
||||
Expect(c.MaxIncomingUniStreams).To(BeEquivalentTo(4321))
|
||||
})
|
||||
|
||||
It("disables unidirectional streams", func() {
|
||||
|
@ -520,7 +520,7 @@ var _ = Describe("Client", func() {
|
|||
MaxIncomingUniStreams: -1,
|
||||
}
|
||||
c := populateClientConfig(config, false)
|
||||
Expect(c.MaxIncomingStreams).To(Equal(1234))
|
||||
Expect(c.MaxIncomingStreams).To(BeEquivalentTo(1234))
|
||||
Expect(c.MaxIncomingUniStreams).To(BeZero())
|
||||
})
|
||||
|
||||
|
|
|
@ -45,9 +45,9 @@ var _ = Describe("Config", func() {
|
|||
case "MaxReceiveConnectionFlowControlWindow":
|
||||
f.Set(reflect.ValueOf(uint64(10)))
|
||||
case "MaxIncomingStreams":
|
||||
f.Set(reflect.ValueOf(11))
|
||||
f.Set(reflect.ValueOf(int64(11)))
|
||||
case "MaxIncomingUniStreams":
|
||||
f.Set(reflect.ValueOf(12))
|
||||
f.Set(reflect.ValueOf(int64(12)))
|
||||
case "StatelessResetKey":
|
||||
f.Set(reflect.ValueOf([]byte{1, 2, 3, 4}))
|
||||
case "KeepAlive":
|
||||
|
@ -114,8 +114,8 @@ var _ = Describe("Config", func() {
|
|||
Expect(c.HandshakeTimeout).To(Equal(protocol.DefaultHandshakeTimeout))
|
||||
Expect(c.MaxReceiveStreamFlowControlWindow).To(BeEquivalentTo(protocol.DefaultMaxReceiveStreamFlowControlWindow))
|
||||
Expect(c.MaxReceiveConnectionFlowControlWindow).To(BeEquivalentTo(protocol.DefaultMaxReceiveConnectionFlowControlWindow))
|
||||
Expect(c.MaxIncomingStreams).To(Equal(protocol.DefaultMaxIncomingStreams))
|
||||
Expect(c.MaxIncomingUniStreams).To(Equal(protocol.DefaultMaxIncomingUniStreams))
|
||||
Expect(c.MaxIncomingStreams).To(BeEquivalentTo(protocol.DefaultMaxIncomingStreams))
|
||||
Expect(c.MaxIncomingUniStreams).To(BeEquivalentTo(protocol.DefaultMaxIncomingUniStreams))
|
||||
})
|
||||
|
||||
It("populates empty fields with default values, for the server", func() {
|
||||
|
|
|
@ -244,11 +244,11 @@ type Config struct {
|
|||
// MaxIncomingStreams is the maximum number of concurrent bidirectional streams that a peer is allowed to open.
|
||||
// If not set, it will default to 100.
|
||||
// If set to a negative value, it doesn't allow any bidirectional streams.
|
||||
MaxIncomingStreams int
|
||||
MaxIncomingStreams int64
|
||||
// MaxIncomingUniStreams is the maximum number of concurrent unidirectional streams that a peer is allowed to open.
|
||||
// If not set, it will default to 100.
|
||||
// If set to a negative value, it doesn't allow any unidirectional streams.
|
||||
MaxIncomingUniStreams int
|
||||
MaxIncomingUniStreams int64
|
||||
// The StatelessResetKey is used to generate stateless reset tokens.
|
||||
// If no key is configured, sending of stateless resets is disabled.
|
||||
StatelessResetKey []byte
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue