mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-03 04:07:35 +03:00
add a quic.Config option for DATAGRAM frames
This commit is contained in:
parent
231bc918d4
commit
913ddc5081
4 changed files with 9 additions and 1 deletions
|
@ -465,6 +465,7 @@ var _ = Describe("Client", func() {
|
|||
ConnectionIDLength: 13,
|
||||
StatelessResetKey: []byte("foobar"),
|
||||
TokenStore: tokenStore,
|
||||
EnableDatagrams: true,
|
||||
}
|
||||
c := populateClientConfig(config, false)
|
||||
Expect(c.HandshakeTimeout).To(Equal(1337 * time.Minute))
|
||||
|
@ -474,6 +475,7 @@ var _ = Describe("Client", func() {
|
|||
Expect(c.ConnectionIDLength).To(Equal(13))
|
||||
Expect(c.StatelessResetKey).To(Equal([]byte("foobar")))
|
||||
Expect(c.TokenStore).To(Equal(tokenStore))
|
||||
Expect(c.EnableDatagrams).To(BeTrue())
|
||||
})
|
||||
|
||||
It("errors when the Config contains an invalid version", func() {
|
||||
|
|
|
@ -98,6 +98,7 @@ func populateConfig(config *Config) *Config {
|
|||
ConnectionIDLength: config.ConnectionIDLength,
|
||||
StatelessResetKey: config.StatelessResetKey,
|
||||
TokenStore: config.TokenStore,
|
||||
EnableDatagrams: config.EnableDatagrams,
|
||||
Tracer: config.Tracer,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -69,6 +69,8 @@ var _ = Describe("Config", func() {
|
|||
f.Set(reflect.ValueOf([]byte{1, 2, 3, 4}))
|
||||
case "KeepAlive":
|
||||
f.Set(reflect.ValueOf(true))
|
||||
case "EnableDatagrams":
|
||||
f.Set(reflect.ValueOf(true))
|
||||
case "Tracer":
|
||||
f.Set(reflect.ValueOf(mocklogging.NewMockTracer(mockCtrl)))
|
||||
default:
|
||||
|
|
|
@ -259,7 +259,10 @@ type Config struct {
|
|||
StatelessResetKey []byte
|
||||
// KeepAlive defines whether this peer will periodically send a packet to keep the connection alive.
|
||||
KeepAlive bool
|
||||
Tracer logging.Tracer
|
||||
// See https://datatracker.ietf.org/doc/draft-ietf-quic-datagram/.
|
||||
// Datagrams will only be available when both peers enable datagram support.
|
||||
EnableDatagrams bool
|
||||
Tracer logging.Tracer
|
||||
}
|
||||
|
||||
// ConnectionState records basic details about a QUIC connection
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue