From 8fd9853bc95a34bd64eead03890caad3a05ac765 Mon Sep 17 00:00:00 2001 From: ziyue <1213642868@qq.com> Date: Fri, 13 Aug 2021 10:59:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84http=E6=96=AD=E5=BC=80?= =?UTF-8?q?=E6=97=B6=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Http/HttpSession.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/Http/HttpSession.cpp b/src/Http/HttpSession.cpp index ebe83bea..2d47e566 100644 --- a/src/Http/HttpSession.cpp +++ b/src/Http/HttpSession.cpp @@ -100,9 +100,9 @@ void HttpSession::onRecv(const Buffer::Ptr &pBuf) { } void HttpSession::onError(const SockException& err) { - if(_is_live_stream){ - uint64_t duration = _ticker.createdTime()/1000; + if (_is_live_stream) { //flv/ts播放器 + uint64_t duration = _ticker.createdTime() / 1000; WarnP(this) << "FLV/TS/FMP4播放器(" << _mediaInfo._vhost << "/" << _mediaInfo._app << "/" @@ -110,19 +110,16 @@ void HttpSession::onError(const SockException& err) { << ")断开:" << err.what() << ",耗时(s):" << duration; - GET_CONFIG(uint32_t,iFlowThreshold,General::kFlowThreshold); - if(_total_bytes_usage >= iFlowThreshold * 1024){ - NoticeCenter::Instance().emitEvent(Broadcast::kBroadcastFlowReport, _mediaInfo, _total_bytes_usage, duration , true, static_cast(*this)); + GET_CONFIG(uint32_t, iFlowThreshold, General::kFlowThreshold); + if (_total_bytes_usage >= iFlowThreshold * 1024) { + NoticeCenter::Instance().emitEvent(Broadcast::kBroadcastFlowReport, _mediaInfo, _total_bytes_usage, + duration, true, static_cast(*this)); } return; } //http客户端 - if (!_is_live_stream) { - TraceP(this) << err.what(); - } else { - WarnP(this) << err.what(); - } + TraceP(this) << err.what(); } void HttpSession::onManager() {