mirror of https://github.com/v2ray/v2ray-core
release buffer
parent
abe790181e
commit
02ce3ffded
|
@ -245,6 +245,8 @@ func (w *AuthenticationWriter) Write(b []byte) (int, error) {
|
|||
}
|
||||
|
||||
func (w *AuthenticationWriter) WriteMultiBuffer(mb buf.MultiBuffer) (int, error) {
|
||||
defer mb.Release()
|
||||
|
||||
const StartIndex = 17 * 1024
|
||||
var totalBytes int
|
||||
for {
|
||||
|
|
|
@ -385,6 +385,8 @@ type UDPWriter struct {
|
|||
}
|
||||
|
||||
func (w *UDPWriter) Write(mb buf.MultiBuffer) error {
|
||||
defer mb.Release()
|
||||
|
||||
for _, b := range mb {
|
||||
if err := w.writeInternal(b); err != nil {
|
||||
return err
|
||||
|
|
Loading…
Reference in New Issue