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)
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
}

View File

@ -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)