Commit 8fd9853b by ziyue

完善http断开时日志

parent ec9b8c64
...@@ -100,9 +100,9 @@ void HttpSession::onRecv(const Buffer::Ptr &pBuf) { ...@@ -100,9 +100,9 @@ void HttpSession::onRecv(const Buffer::Ptr &pBuf) {
} }
void HttpSession::onError(const SockException& err) { void HttpSession::onError(const SockException& err) {
if(_is_live_stream){ if (_is_live_stream) {
uint64_t duration = _ticker.createdTime()/1000;
//flv/ts播放器 //flv/ts播放器
uint64_t duration = _ticker.createdTime() / 1000;
WarnP(this) << "FLV/TS/FMP4播放器(" WarnP(this) << "FLV/TS/FMP4播放器("
<< _mediaInfo._vhost << "/" << _mediaInfo._vhost << "/"
<< _mediaInfo._app << "/" << _mediaInfo._app << "/"
...@@ -110,19 +110,16 @@ void HttpSession::onError(const SockException& err) { ...@@ -110,19 +110,16 @@ void HttpSession::onError(const SockException& err) {
<< ")断开:" << err.what() << ")断开:" << err.what()
<< ",耗时(s):" << duration; << ",耗时(s):" << duration;
GET_CONFIG(uint32_t,iFlowThreshold,General::kFlowThreshold); GET_CONFIG(uint32_t, iFlowThreshold, General::kFlowThreshold);
if(_total_bytes_usage >= iFlowThreshold * 1024){ if (_total_bytes_usage >= iFlowThreshold * 1024) {
NoticeCenter::Instance().emitEvent(Broadcast::kBroadcastFlowReport, _mediaInfo, _total_bytes_usage, duration , true, static_cast<SockInfo &>(*this)); NoticeCenter::Instance().emitEvent(Broadcast::kBroadcastFlowReport, _mediaInfo, _total_bytes_usage,
duration, true, static_cast<SockInfo &>(*this));
} }
return; return;
} }
//http客户端 //http客户端
if (!_is_live_stream) {
TraceP(this) << err.what(); TraceP(this) << err.what();
} else {
WarnP(this) << err.what();
}
} }
void HttpSession::onManager() { void HttpSession::onManager() {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论