rename the logging.CloseReason to TimeoutReason

This commit is contained in:
Marten Seemann 2020-07-10 12:37:36 +07:00
parent 53856bda60
commit 7d6ce4ea45
10 changed files with 31 additions and 24 deletions

View file

@ -8,6 +8,7 @@ import (
"github.com/lucas-clemente/quic-go/internal/congestion"
"github.com/lucas-clemente/quic-go/internal/protocol"
"github.com/lucas-clemente/quic-go/internal/qerr"
"github.com/lucas-clemente/quic-go/internal/wire"
)
@ -32,6 +33,7 @@ type (
StreamType = protocol.StreamType
// The VersionNumber is the QUIC version.
VersionNumber = protocol.VersionNumber
// The Header is the QUIC packet header, before removing header protection.
Header = wire.Header
// The ExtendedHeader is the QUIC packet header, after removing header protection.
@ -39,6 +41,11 @@ type (
// The TransportParameters are QUIC transport parameters.
TransportParameters = wire.TransportParameters
// A TransportError is a transport-level error code.
TransportError = qerr.ErrorCode
// An ApplicationError is an application-defined error code.
ApplicationError = qerr.ErrorCode
// The RTTStats contain statistics used by the congestion controller.
RTTStats = congestion.RTTStats
)
@ -77,7 +84,7 @@ type Tracer interface {
// A ConnectionTracer records events.
type ConnectionTracer interface {
StartedConnection(local, remote net.Addr, version VersionNumber, srcConnID, destConnID ConnectionID)
ClosedConnection(CloseReason)
ClosedConnection(TimeoutReason)
SentTransportParameters(*TransportParameters)
ReceivedTransportParameters(*TransportParameters)
SentPacket(hdr *ExtendedHeader, packetSize ByteCount, ack *AckFrame, frames []Frame)

View file

@ -70,14 +70,14 @@ const (
TimerTypePTO
)
// CloseReason is the reason why a session is closed
type CloseReason uint8
// TimeoutReason is the reason why a session is closed
type TimeoutReason uint8
const (
// CloseReasonHandshakeTimeout is used when the session is closed due to a handshake timeout
// TimeoutReasonHandshake is used when the session is closed due to a handshake timeout
// This reason is not defined in the qlog draft, but very useful for debugging.
CloseReasonHandshakeTimeout CloseReason = iota
// CloseReasonIdleTimeout is used when the session is closed due to an idle timeout
TimeoutReasonHandshake TimeoutReason = iota
// TimeoutReasonIdle is used when the session is closed due to an idle timeout
// This reason is not defined in the qlog draft, but very useful for debugging.
CloseReasonIdleTimeout
TimeoutReasonIdle
)