mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-03 20:27:35 +03:00
Merge pull request #3745 from quic-go/aggressive-key-updates
initiate the first key update after sending / receiving 100 packets
This commit is contained in:
commit
379e7ec848
4 changed files with 100 additions and 29 deletions
|
@ -51,12 +51,14 @@ func (t *keyUpdateConnTracer) ReceivedShortHeaderPacket(hdr *logging.ShortHeader
|
|||
}
|
||||
|
||||
var _ = Describe("Key Update tests", func() {
|
||||
var server quic.Listener
|
||||
It("downloads a large file", func() {
|
||||
origKeyUpdateInterval := handshake.KeyUpdateInterval
|
||||
defer func() { handshake.KeyUpdateInterval = origKeyUpdateInterval }()
|
||||
handshake.KeyUpdateInterval = 1 // update keys as frequently as possible
|
||||
|
||||
runServer := func() {
|
||||
var err error
|
||||
server, err = quic.ListenAddr("localhost:0", getTLSConfig(), nil)
|
||||
server, err := quic.ListenAddr("localhost:0", getTLSConfig(), nil)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
defer server.Close()
|
||||
|
||||
go func() {
|
||||
defer GinkgoRecover()
|
||||
|
@ -68,14 +70,7 @@ var _ = Describe("Key Update tests", func() {
|
|||
_, err = str.Write(PRDataLong)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
}()
|
||||
}
|
||||
|
||||
It("downloads a large file", func() {
|
||||
origKeyUpdateInterval := handshake.KeyUpdateInterval
|
||||
defer func() { handshake.KeyUpdateInterval = origKeyUpdateInterval }()
|
||||
handshake.KeyUpdateInterval = 1 // update keys as frequently as possible
|
||||
|
||||
runServer()
|
||||
conn, err := quic.DialAddr(
|
||||
fmt.Sprintf("localhost:%d", server.Addr().(*net.UDPAddr).Port),
|
||||
getTLSClientConfig(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue