Merge commit from fork

Signed-off-by: Cherrling <me@cherr.cc>
This commit is contained in:
白日梦主义 2026-05-22 04:11:40 +08:00 committed by GitHub
parent 89521dd80a
commit d6f24e13d7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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