mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-03 20:27:35 +03:00
introduce a dedicated qerr.TransportError and qerr.ApplicationError
This commit is contained in:
parent
ddeb2281fc
commit
592fb9cad9
57 changed files with 845 additions and 521 deletions
|
@ -22,10 +22,15 @@ type statelessResetErr struct {
|
|||
token protocol.StatelessResetToken
|
||||
}
|
||||
|
||||
func (e statelessResetErr) Error() string {
|
||||
func (e *statelessResetErr) Error() string {
|
||||
return fmt.Sprintf("received a stateless reset with token %x", e.token)
|
||||
}
|
||||
|
||||
func (e *statelessResetErr) Is(target error) bool {
|
||||
_, ok := target.(*statelessResetErr)
|
||||
return ok
|
||||
}
|
||||
|
||||
type zeroRTTQueue struct {
|
||||
queue []*receivedPacket
|
||||
retireTimer *time.Timer
|
||||
|
@ -430,7 +435,7 @@ func (h *packetHandlerMap) maybeHandleStatelessReset(data []byte) bool {
|
|||
copy(token[:], data[len(data)-16:])
|
||||
if sess, ok := h.resetTokens[token]; ok {
|
||||
h.logger.Debugf("Received a stateless reset with token %#x. Closing session.", token)
|
||||
go sess.destroy(statelessResetErr{token: token})
|
||||
go sess.destroy(&statelessResetErr{token: token})
|
||||
return true
|
||||
}
|
||||
return false
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue