Fix: recycle buf on http obfs
This commit is contained in:
parent
6521acf8f1
commit
ee72865f48
@ -28,6 +28,7 @@ func (ho *HTTPObfs) Read(b []byte) (int, error) {
|
|||||||
n := copy(b, ho.buf[ho.offset:])
|
n := copy(b, ho.buf[ho.offset:])
|
||||||
ho.offset += n
|
ho.offset += n
|
||||||
if ho.offset == len(ho.buf) {
|
if ho.offset == len(ho.buf) {
|
||||||
|
pool.Put(ho.buf)
|
||||||
ho.buf = nil
|
ho.buf = nil
|
||||||
}
|
}
|
||||||
return n, nil
|
return n, nil
|
||||||
|
Reference in New Issue
Block a user