forked from quic-go/quic-go
@@ -37,7 +37,7 @@ func (u *packetUnpacker) Unpack(publicHeaderBinary []byte, hdr *publicHeader, r
|
|||||||
}
|
}
|
||||||
entropyBit := privateFlag&0x01 > 0
|
entropyBit := privateFlag&0x01 > 0
|
||||||
|
|
||||||
fs := []frames.Frame{}
|
fs := make([]frames.Frame, 0, 1)
|
||||||
|
|
||||||
// Read all frames in the packet
|
// Read all frames in the packet
|
||||||
ReadLoop:
|
ReadLoop:
|
||||||
|
|||||||
@@ -545,6 +545,10 @@ func (s *Session) sendConnectionClose(quicErr *qerr.QuicError) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *Session) logPacket(packet *packedPacket) {
|
func (s *Session) logPacket(packet *packedPacket) {
|
||||||
|
if !utils.Debug() {
|
||||||
|
// We don't need to allocate the slices for calling the format functions
|
||||||
|
return
|
||||||
|
}
|
||||||
utils.Debugf("-> Sending packet 0x%x (%d bytes)", packet.number, len(packet.raw))
|
utils.Debugf("-> Sending packet 0x%x (%d bytes)", packet.number, len(packet.raw))
|
||||||
for _, frame := range packet.frames {
|
for _, frame := range packet.frames {
|
||||||
if streamFrame, isStreamFrame := frame.(*frames.StreamFrame); isStreamFrame {
|
if streamFrame, isStreamFrame := frame.(*frames.StreamFrame); isStreamFrame {
|
||||||
|
|||||||
@@ -58,3 +58,8 @@ func Errorf(format string, args ...interface{}) {
|
|||||||
mutex.Unlock()
|
mutex.Unlock()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Debug returns true if the log level is LogLevelDebug
|
||||||
|
func Debug() bool {
|
||||||
|
return logLevel == LogLevelDebug
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user