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

Fix #2837: Callback: Support stream_url and stream_id. v5.0.55

This commit is contained in:
winlin 2022-08-30 22:04:13 +08:00
parent 9c6774b644
commit 6a108fab6d
14 changed files with 184 additions and 80 deletions

View file

@ -292,6 +292,7 @@ SrsHttpxConn::SrsHttpxConn(bool https, ISrsResourceManager* cm, srs_netfd_t fd,
manager = cm;
skt = new SrsTcpConnection(fd);
enable_stat_ = false;
if (https) {
ssl = new SrsSslConnection(skt);
@ -313,6 +314,11 @@ SrsHttpxConn::~SrsHttpxConn()
srs_freep(skt);
}
void SrsHttpxConn::set_enable_stat(bool v)
{
enable_stat_ = v;
}
srs_error_t SrsHttpxConn::pop_message(ISrsHttpMessage** preq)
{
srs_error_t err = srs_success;
@ -399,9 +405,8 @@ srs_error_t SrsHttpxConn::on_message_done(ISrsHttpMessage* r, SrsHttpResponseWri
srs_error_t SrsHttpxConn::on_conn_done(srs_error_t r0)
{
// Only stat the HTTP streaming clients, ignore all API clients.
bool exists = false;
SrsStatistic::instance()->on_disconnect(get_id().c_str(), &exists);
if (exists) {
if (enable_stat_) {
SrsStatistic::instance()->on_disconnect(get_id().c_str());
SrsStatistic::instance()->kbps_add_delta(get_id().c_str(), conn->delta());
}