forked from quic-go/quic-go
close the TLS crypto setup when session closes
This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user