1
0
mirror of https://github.com/fumiama/WireGold.git synced 2026-06-13 05:31:08 +08:00

add istransfer option in link.Write

This commit is contained in:
fumiama
2021-12-30 16:03:08 +08:00
parent 6627881c63
commit c3d05635f0
7 changed files with 17 additions and 10 deletions

View File

@@ -86,7 +86,9 @@ func (p *Packet) Marshal(src net.IP) []byte {
}
p.DataSZ = uint32(len(p.Data))
p.Src = src
if src != nil {
p.Src = src
}
packet := make([]byte, 52+len(p.Data))
binary.LittleEndian.PutUint32(packet[:4], p.DataSZ)