This commit is contained in:
esrrhs 2018-12-20 14:22:28 +08:00
parent d7a5a8d9af
commit b18a569dcd
2 changed files with 2 additions and 3 deletions

View File

@ -174,7 +174,6 @@ func (p *Client) processPacket(packet *Packet) {
t.UnmarshalBinary(packet.data) t.UnmarshalBinary(packet.data)
d := time.Now().Sub(t) d := time.Now().Sub(t)
fmt.Printf("pong from %s %s\n", packet.src.String(), d.String()) 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 return
} }

View File

@ -69,7 +69,7 @@ func (p *Server) processPacket(packet *Packet) {
t := time.Time{} t := time.Time{}
t.UnmarshalBinary(packet.data) t.UnmarshalBinary(packet.data)
fmt.Printf("ping from %s %s %d\n", packet.src.String(), t.String(), packet.rproto) 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 return
} }
@ -136,7 +136,7 @@ func (p *Server) Recv(conn *ServerConn, id string, src *net.IPAddr) {
now := time.Now() now := time.Now()
conn.activeTime = 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.sendPacket++
p.sendPacketSize += (uint64)(n) p.sendPacketSize += (uint64)(n)