From bd9492d9ceab01434698e1b91c30b2e017038c67 Mon Sep 17 00:00:00 2001 From: qydysky Date: Wed, 1 Nov 2023 01:12:35 +0800 Subject: [PATCH] =?utf8?q?Improve=20web=E6=9C=8D=E5=8A=A1=E6=97=A5?= =?utf8?q?=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- Reply/F.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Reply/F.go b/Reply/F.go index c4c5e35..7b37d43 100644 --- a/Reply/F.go +++ b/Reply/F.go @@ -1482,7 +1482,10 @@ func init() { // w.Header().Add(`Content-Range`, fmt.Sprintf("bytes %d-%d/%d", rangeHeaderNum, fi.Size()-1, fi.Size())) // w.WriteHeader(http.StatusPartialContent) - flog.L(`T: `, r.RemoteAddr, `接入录播`+v) + flog.L(`T: `, r.RemoteAddr, `接入录播`) + ts := time.Now() + defer func() { flog.L(`T: `, r.RemoteAddr, `断开录播`, time.Since(ts)) }() + if e := f.CopyToIoWriter(pweb.WithFlush(w), pio.CopyConfig{BytePerSec: speed}); e != nil { flog.L(`E: `, e) } @@ -1513,11 +1516,11 @@ func init() { // 推送数据 { startFunc := func(_ *M4SStream) error { - flog.L(`T: `, r.RemoteAddr, `接入直播流`) + flog.L(`T: `, r.RemoteAddr, `接入直播`) return nil } stopFunc := func(_ *M4SStream) error { - flog.L(`T: `, r.RemoteAddr, `断开直播流`) + flog.L(`T: `, r.RemoteAddr, `断开直播`) return nil } -- 2.39.2