1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-11-17 18:06:15 -05:00

fix multibuf len

This commit is contained in:
Darien Raymond 2018-04-18 11:45:40 +02:00
parent 3137eba542
commit e6446d43c8
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

View File

@ -179,9 +179,13 @@ func (mb *MultiBuffer) WriteMultiBuffer(b MultiBuffer) error {
} }
// Len returns the total number of bytes in the MultiBuffer. // Len returns the total number of bytes in the MultiBuffer.
func (mb MultiBuffer) Len() int32 { func (mb *MultiBuffer) Len() int32 {
if mb == nil {
return 0
}
size := int32(0) size := int32(0)
for _, b := range mb { for _, b := range *mb {
size += b.Len() size += b.Len()
} }
return size return size