Merge commit from fork
Signed-off-by: Cherrling <me@cherr.cc>
This commit is contained in:
parent
89521dd80a
commit
d6f24e13d7
1 changed files with 3 additions and 0 deletions
|
|
@ -10,6 +10,9 @@ func FragUDPMessage(m *protocol.UDPMessage, maxSize int) []protocol.UDPMessage {
|
|||
}
|
||||
fullPayload := m.Data
|
||||
maxPayloadSize := maxSize - m.HeaderSize()
|
||||
if maxPayloadSize <= 0 {
|
||||
return nil
|
||||
}
|
||||
off := 0
|
||||
fragID := uint8(0)
|
||||
fragCount := uint8((len(fullPayload) + maxPayloadSize - 1) / maxPayloadSize) // round up
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue