1
0
mirror of https://github.com/fumiama/WireGold.git synced 2026-06-04 23:40:26 +08:00

fix 分片

This commit is contained in:
fumiama
2021-12-31 14:05:53 +08:00
parent c56ef8be45
commit af21d53f34

View File

@@ -76,6 +76,10 @@ func (l *Link) Read() *head.Packet {
// Write 向 peer 发包
func (l *Link) Write(p *head.Packet, istransfer bool) (n int, err error) {
if len(p.Data) <= int(l.me.mtu) {
if !istransfer {
p.FillHash()
p.Data = l.Encode(p.Data)
}
return l.write(p, 0, istransfer, false)
}
p.FillHash()