mirror of
https://github.com/fumiama/WireGold.git
synced 2026-06-06 08:20:25 +08:00
add more logs
This commit is contained in:
@@ -63,9 +63,10 @@ func (m *Me) listenthread(conn *net.UDPConn, mu *sync.Mutex) {
|
||||
case p.IsToMe(packet.Dst):
|
||||
packet.Data = p.Decode(uint8(packet.TeaTypeDataSZ>>28), packet.Data)
|
||||
if p.aead != nil {
|
||||
packet.Data = p.DecodePreshared(packet.AdditionalData(), packet.Data)
|
||||
addt := packet.AdditionalData()
|
||||
packet.Data = p.DecodePreshared(addt, packet.Data)
|
||||
if packet.Data == nil {
|
||||
logrus.Debugln("[listen] drop invalid additional data packet")
|
||||
logrus.Debugln("[listen] drop invalid additional data packet:", addt)
|
||||
packet.Put()
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ import (
|
||||
func (l *Link) WriteAndPut(p *head.Packet, istransfer bool) (n int, err error) {
|
||||
teatype := uint8(rand.Intn(16))
|
||||
sndcnt := atomic.AddUintptr(&l.sendcount, 1)
|
||||
logrus.Debugln("[send] count:", sndcnt, "additional data:", uint16(sndcnt))
|
||||
if len(p.Data) <= int(l.mtu) {
|
||||
if !istransfer {
|
||||
p.FillHash()
|
||||
|
||||
Reference in New Issue
Block a user