1
0
mirror of https://github.com/fumiama/WireGold.git synced 2026-06-12 12:50:28 +08:00

feat(head): packet SetBody recv Bytes

This commit is contained in:
源文雨
2025-02-26 00:09:50 +09:00
parent f0a853e449
commit 689dfbc174
3 changed files with 37 additions and 37 deletions

View File

@@ -270,10 +270,10 @@ func (p *Packet) BodyLen() int {
return p.b - p.a
}
func (p *Packet) SetBody(b []byte) {
func (p *Packet) SetBody(b pbuf.Bytes) {
p.a = 0
p.b = len(b)
p.data = pbuf.ParseBytes(b...)
p.b = b.Len()
p.data = b
}
func (p *Packet) CropBody(a, b int) {