1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

STAT: Ignore stat for API, only for HTTP streaming clients.

This commit is contained in:
winlin 2022-08-29 07:54:40 +08:00
parent 28154e820c
commit bc569d91a0
3 changed files with 12 additions and 11 deletions

View file

@ -400,10 +400,12 @@ srs_error_t SrsHttpxConn::on_message_done(ISrsHttpMessage* r, SrsHttpResponseWri
srs_error_t SrsHttpxConn::on_conn_done(srs_error_t r0)
{
// Update statistic when done.
SrsStatistic* stat = SrsStatistic::instance();
stat->kbps_add_delta(get_id().c_str(), this);
stat->on_disconnect(get_id().c_str());
// Only stat the HTTP streaming clients, ignore all API clients.
bool exists = false;
SrsStatistic::instance()->on_disconnect(get_id().c_str(), &exists);
if (exists) {
SrsStatistic::instance()->kbps_add_delta(get_id().c_str(), this);
}
// Because we use manager to manage this object,
// not the http connection object, so we must remove it here.