mirror of
https://github.com/v2fly/v2ray-core.git
synced 2026-01-04 08:15:21 -05:00
fix snifer
This commit is contained in:
@@ -31,6 +31,18 @@ func (mb *MultiBuffer) AppendMulti(buf MultiBuffer) {
|
||||
*mb = append(*mb, buf...)
|
||||
}
|
||||
|
||||
func (mb MultiBuffer) Copy(b []byte) int {
|
||||
total := 0
|
||||
for _, bb := range mb {
|
||||
nBytes := copy(b[total:], bb.Bytes())
|
||||
total += nBytes
|
||||
if nBytes < bb.Len() {
|
||||
break
|
||||
}
|
||||
}
|
||||
return total
|
||||
}
|
||||
|
||||
func (mb *MultiBuffer) Read(b []byte) (int, error) {
|
||||
endIndex := len(*mb)
|
||||
totalBytes := 0
|
||||
|
||||
Reference in New Issue
Block a user