mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-06 21:57:36 +03:00
close the TLS crypto setup when session closes
This commit is contained in:
parent
06f96f4b6e
commit
8344dc8b64
2 changed files with 5 additions and 0 deletions
|
@ -6,6 +6,7 @@ import (
|
|||
"crypto/tls"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"net"
|
||||
"sync"
|
||||
"time"
|
||||
|
@ -603,6 +604,9 @@ runLoop:
|
|||
}
|
||||
s.logger.Infof("Connection %s closed.", s.srcConnID)
|
||||
s.sessionRunner.removeConnectionID(s.srcConnID)
|
||||
if s.version.UsesTLS() {
|
||||
s.cryptoStreamHandler.(io.Closer).Close()
|
||||
}
|
||||
return closeErr.err
|
||||
}
|
||||
|
||||
|
|
|
@ -1638,6 +1638,7 @@ var _ = Describe("Client Session", func() {
|
|||
})
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
// make sure the go routine returns
|
||||
sess.version = protocol.Version39
|
||||
packer.EXPECT().PackConnectionClose(gomock.Any()).Return(&packedPacket{}, nil)
|
||||
sessionRunner.EXPECT().removeConnectionID(gomock.Any())
|
||||
Expect(sess.Close()).To(Succeed())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue