forked from quic-go/quic-go
implement receiving of Public Resets for the client
When a Public Reset is received, the client validates if it was sent from the correct remote address and if the connection ID matches. When a valid Public Reset is received, the connection is closed immediately.
This commit is contained in:
@@ -23,6 +23,7 @@ type mockSession struct {
|
||||
packetCount int
|
||||
closed bool
|
||||
closeReason error
|
||||
closedRemote bool
|
||||
stopRunLoop chan struct{} // run returns as soon as this channel receives a value
|
||||
handshakeChan chan handshakeEvent
|
||||
handshakeComplete chan error // for WaitUntilHandshakeComplete
|
||||
@@ -51,6 +52,12 @@ func (s *mockSession) Close(e error) error {
|
||||
close(s.stopRunLoop)
|
||||
return nil
|
||||
}
|
||||
func (s *mockSession) closeRemote(e error) {
|
||||
s.closeReason = e
|
||||
s.closed = true
|
||||
s.closedRemote = true
|
||||
close(s.stopRunLoop)
|
||||
}
|
||||
func (s *mockSession) AcceptStream() (Stream, error) {
|
||||
panic("not implemented")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user