mirror of
https://github.com/cloudflare/cloudflared.git
synced 2025-05-14 22:46:35 +00:00

- Added a QUIC server to accept streams - Unit test for this server also tests ALPN - Temporary echo capability for HTTP ConnectionType
28 lines
628 B
Go
28 lines
628 B
Go
package logging
|
|
|
|
import (
|
|
"github.com/lucas-clemente/quic-go/internal/protocol"
|
|
)
|
|
|
|
// PacketTypeFromHeader determines the packet type from a *wire.Header.
|
|
func PacketTypeFromHeader(hdr *Header) PacketType {
|
|
if !hdr.IsLongHeader {
|
|
return PacketType1RTT
|
|
}
|
|
if hdr.Version == 0 {
|
|
return PacketTypeVersionNegotiation
|
|
}
|
|
switch hdr.Type {
|
|
case protocol.PacketTypeInitial:
|
|
return PacketTypeInitial
|
|
case protocol.PacketTypeHandshake:
|
|
return PacketTypeHandshake
|
|
case protocol.PacketType0RTT:
|
|
return PacketType0RTT
|
|
case protocol.PacketTypeRetry:
|
|
return PacketTypeRetry
|
|
default:
|
|
return PacketTypeNotDetermined
|
|
}
|
|
}
|