forked from quic-go/quic-go
Merge pull request #681 from lucas-clemente/session-logging
add some more logging to the session
This commit is contained in:
@@ -93,7 +93,7 @@ func DialNonFWSecure(pconn net.PacketConn, remoteAddr net.Addr, host string, con
|
||||
return nil, err
|
||||
}
|
||||
|
||||
utils.Infof("Starting new connection to %s (%s), connectionID %x, version %d", hostname, c.conn.RemoteAddr().String(), c.connectionID, c.version)
|
||||
utils.Infof("Starting new connection to %s (%s -> %s), connectionID %x, version %d", hostname, c.conn.LocalAddr().String(), c.conn.RemoteAddr().String(), c.connectionID, c.version)
|
||||
|
||||
return c.session.(NonFWSession), c.establishSecureConnection()
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ var _ = Describe("Client", func() {
|
||||
Eventually(areSessionsRunning).Should(BeFalse())
|
||||
msess, _, _ := newMockSession(nil, 0, 0, nil, nil)
|
||||
sess = msess.(*mockSession)
|
||||
packetConn = &mockPacketConn{}
|
||||
packetConn = &mockPacketConn{addr: &net.UDPAddr{IP: net.IPv4(127, 0, 0, 1), Port: 1234}}
|
||||
config = &Config{
|
||||
Versions: []protocol.VersionNumber{protocol.SupportedVersions[0], 77, 78},
|
||||
}
|
||||
|
||||
@@ -690,7 +690,7 @@ func (s *session) logPacket(packet *packedPacket) {
|
||||
return
|
||||
}
|
||||
if utils.Debug() {
|
||||
utils.Debugf("-> Sending packet 0x%x (%d bytes), %s", packet.number, len(packet.raw), packet.encryptionLevel)
|
||||
utils.Debugf("-> Sending packet 0x%x (%d bytes) for connection %x, %s", packet.number, len(packet.raw), s.connectionID, packet.encryptionLevel)
|
||||
for _, frame := range packet.frames {
|
||||
frames.LogFrame(frame, true)
|
||||
}
|
||||
@@ -775,6 +775,7 @@ func (s *session) scheduleSending() {
|
||||
|
||||
func (s *session) tryQueueingUndecryptablePacket(p *receivedPacket) {
|
||||
if s.handshakeComplete {
|
||||
utils.Debugf("Received undecryptable packet from %s after the handshake: %#v, %d bytes data", p.remoteAddr.String(), p.publicHeader, len(p.data))
|
||||
return
|
||||
}
|
||||
if len(s.undecryptablePackets)+1 > protocol.MaxUndecryptablePackets {
|
||||
|
||||
@@ -1290,7 +1290,11 @@ var _ = Describe("Session", func() {
|
||||
hdr := &PublicHeader{
|
||||
PacketNumber: protocol.PacketNumber(i + 1),
|
||||
}
|
||||
sess.handlePacket(&receivedPacket{publicHeader: hdr, data: []byte("foobar")})
|
||||
sess.handlePacket(&receivedPacket{
|
||||
publicHeader: hdr,
|
||||
remoteAddr: &net.UDPAddr{IP: net.IPv4(127, 0, 0, 1), Port: 1234},
|
||||
data: []byte("foobar"),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user