1
0
mirror of https://github.com/fumiama/WireGold.git synced 2026-07-01 08:10:22 +08:00

optimize(head): packet encapsuling

This commit is contained in:
源文雨
2024-07-13 00:22:20 +09:00
parent 8215abb695
commit 6ede65bf28
6 changed files with 136 additions and 26 deletions

View File

@@ -35,7 +35,7 @@ func (l *Link) WriteAndPut(p *head.Packet, istransfer bool) (n int, err error) {
if len(p.Data) <= delta {
return l.write(p, teatype, sndcnt, uint32(len(p.Data)), 0, istransfer, false)
}
if istransfer && p.Flags&0x4000 == 0x4000 && len(p.Data) > delta {
if istransfer && p.Flags.DontFrag() && len(p.Data) > delta {
return 0, errors.New("drop don't fragmnet big trans packet")
}
data := p.Data