From b18a569dcd541270548bc8470400e9df81474344 Mon Sep 17 00:00:00 2001 From: esrrhs Date: Thu, 20 Dec 2018 14:22:28 +0800 Subject: [PATCH] update --- client.go | 1 - server.go | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/client.go b/client.go index 5533211..afaec74 100644 --- a/client.go +++ b/client.go @@ -174,7 +174,6 @@ func (p *Client) processPacket(packet *Packet) { t.UnmarshalBinary(packet.data) d := time.Now().Sub(t) fmt.Printf("pong from %s %s\n", packet.src.String(), d.String()) - sendICMP(*p.conn, packet.src, "", "", (uint32)(DATA), packet.data, packet.rproto, 0) return } diff --git a/server.go b/server.go index cc2cb24..ab17829 100644 --- a/server.go +++ b/server.go @@ -69,7 +69,7 @@ func (p *Server) processPacket(packet *Packet) { t := time.Time{} t.UnmarshalBinary(packet.data) fmt.Printf("ping from %s %s %d\n", packet.src.String(), t.String(), packet.rproto) - sendICMP(*p.conn, packet.src, "", "", (uint32)(PING), packet.data, packet.rproto, 0) + sendICMP(*p.conn, packet.src, "", "", (uint32)(PING), packet.data, packet.rproto, -1) return } @@ -136,7 +136,7 @@ func (p *Server) Recv(conn *ServerConn, id string, src *net.IPAddr) { now := time.Now() conn.activeTime = now - sendICMP(*p.conn, src, "", id, (uint32)(DATA), bytes[:n], conn.rproto, 0) + sendICMP(*p.conn, src, "", id, (uint32)(DATA), bytes[:n], conn.rproto, -1) p.sendPacket++ p.sendPacketSize += (uint64)(n)