From f4140d4c561d659b2f2dcbb63a80ff701654d9e6 Mon Sep 17 00:00:00 2001 From: qydysky Date: Sun, 10 Mar 2024 18:28:01 +0800 Subject: [PATCH] =?utf8?q?Improve=20=E7=B2=BE=E7=AE=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- Reply/stream.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Reply/stream.go b/Reply/stream.go index 8da56ac..dc284d1 100644 --- a/Reply/stream.go +++ b/Reply/stream.go @@ -1467,10 +1467,8 @@ func (t *M4SStream) PusherToHttp(conn net.Conn, w http.ResponseWriter, r *http.R func (t *M4SStream) bootBufPush(buf []byte) { t.boot_buf_locker.Lock() defer t.boot_buf_locker.Unlock() - if len(t.boot_buf) < len(buf) { - t.boot_buf = append(t.boot_buf, make([]byte, len(buf)-len(t.boot_buf))...) - } - t.boot_buf = t.boot_buf[:copy(t.boot_buf, buf)] + t.boot_buf = t.boot_buf[:0] + t.boot_buf = append(t.boot_buf, buf...) } func (t *M4SStream) bootBufRead(r func(data []byte) error) error { -- 2.39.2